相关性失败 - 皮尔逊
我想将有关相关性的信息写入数据文件,如下所示:
*korelacja=cor(p2,d2,method="pearson",use = "complete.obs")
korelacja2=cor(p2,d2,method="kendall",use = "complete.obs")
korelacja3=cor(p2,d2,method="spearman",use = "complete.obs")
dane=paste(korelacja,korelacja2,korelacja3,sep=';')
write(dane,file=nazwa,append=TRUE)*
结果对我来说很奇怪 - Pearson 相关性非常高(始终等于 1),但 Kendall 和 Spearman 非常低。我创建了散点图,但没有看到线性相关性。
I want to write to datafile information about correlation as follows:
*korelacja=cor(p2,d2,method="pearson",use = "complete.obs")
korelacja2=cor(p2,d2,method="kendall",use = "complete.obs")
korelacja3=cor(p2,d2,method="spearman",use = "complete.obs")
dane=paste(korelacja,korelacja2,korelacja3,sep=';')
write(dane,file=nazwa,append=TRUE)*
Results are strange for me - Pearson correlation is very high (always equal one), but Kendall and Spearman is very low. I create scatterplots and I don't see linear correlation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果数据中存在一些较大的异常值,这些异常值在 Pearson 相关性中占主导地位,但在非参数(Kendall/Spearman)方法中相对不显着,那么复制此模式并不困难。例如,这里有一个炮制的数据集,除了一个大的异常值之外没有任何变化:
这与到目前为止您的描述一致,尽管在这种情况下您应该能够在散点图中看到异常值......
It's not hard to replicate this pattern if you have some large outliers in your data that dominate the Pearson correlation but are relatively insignificant in the non-parametric (Kendall/Spearman) approaches. For example, here's a concocted data set with nothing going on except for one large outlier:
This is consistent with your description so far, although you ought in this case to be able to see the outliers in your scatterplots ...