小编Ala*_*air的帖子

Seaborn Pairplot Pearsons P统计

我一直在从事python/seaborn/scipy.stats/matplotlib.pyplot等新手的数据分析工作.

SeGorn Correlation Coefficient on PairGrid 这个链接帮助我通过皮尔森R得分呈现我的变量之间的关系.然而,由于Pearsons测试的输出也应具有ap值以表明统计显着性,我正在研究将P值添加到我的图上的注释的方法.

g = sns.pairplot(unoutlieddata, vars=['bia', 'DW', 'HW', 'jackson', 'girths'], kind="reg")

def corrfunc(x, y, **kws):
    r, _ = sps.pearsonr(x, y)
    ax = plt.gca()
    ax.annotate("r = {:.2f}".format(r),
                xy=(.1, .9), xycoords=ax.transAxes)

g.map(corrfunc)
sns.plt.show()
Run Code Online (Sandbox Code Playgroud)

显示的是我提供的链接格式的代码.SPS = scipy.stats.未提供的数据是已过滤以删除异常值的数据帧

任何想法都是神奇的

问候

python matplotlib scipy seaborn

3
推荐指数
1
解决办法
3200
查看次数

标签 统计

matplotlib ×1

python ×1

scipy ×1

seaborn ×1