[英]Pearsonr and p-value
I am analyzing some data in pandas and plotting correlations between two variables using sns.jointplot()
function.我正在分析熊猫中的一些数据并使用
sns.jointplot()
函数绘制两个变量之间的相关性。 The results for correlation between these two function looks like this:这两个函数之间的相关性结果如下所示:
The value for pearsonr is 0.41 and p is 5e-18. pearsonr 的值为 0.41,p 为 5e-18。 What can i infer from these two values.
我可以从这两个值中推断出什么。 Is there a good relationship between these two variables are not.
这两个变量之间有没有很好的关系。
Also if I want to just display pearsonr on the plot, how should I change my code.另外,如果我只想在绘图上显示 pearsonr,我应该如何更改我的代码。 Below is the code that I a using currently.
下面是我目前使用的代码。
ax=sns.jointplot(df['Comfort'], df['Assurance'],data=df, kind="kde", color='r');
The value for pearsonr is 0.41 and p is 5e-18.
pearsonr 的值为 0.41,p 为 5e-18。 What can i infer from these two values.
我可以从这两个值中推断出什么。 Is there a good relationship between these two variables are not.
这两个变量之间有没有很好的关系。
Roughly speaking:大致说来:
0.41
) suggests a low positive correlation.0.41
) 的大小表明低正相关。5e-18
) suggests that the correlation coefficient is statistically significant, being much less than 0.01 (0.01 ---> the risk of concluding that a correlation exists when, actually, no correlation exists is 1%). 5e-18
) 表明相关系数具有统计显着性,远小于 0.01(0.01 ---> 在实际上不存在相关性时得出相关性存在的风险为 1%)。0
for variables (datasets) with a strong nonlinear relationship.0
。 Moreover, you are assuming that your variables (datasets) are normally distributed.Also if I want to just display pearsonr on the plot, how should I change my code.
另外,如果我只想在绘图上显示 pearsonr,我应该如何更改我的代码。
seaborn 0.9.0
does not display that information. seaborn 0.9.0
不显示该信息。 To add that information, you can compute the value using scipy.stats.pearsonr
, then showing it as part of the title of your figure.要添加该信息,您可以使用
scipy.stats.pearsonr
计算该值,然后将其显示为图形标题的一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.