Spearman 相关性与 PerformanceAnalytics Chart.correlation:如何避免“无法计算带关系的精确 p 值”?

问题描述 投票:0回答:1

我对 R 非常陌生(一般来说,对于与编码有关的任何事情),所以请耐心等待......

我正在数据矩阵上运行 Spearman 等级相关,并在 Rstudio 中包含以下代码:

Experts <- read.table(file="full_vs_experts.txt", header=TRUE, row.names=1)
head(Experts, n=16)
res <- cor(Experts, method="spearman")
round(res, 2)
library("Hmisc")
res2 <- rcorr((as.matrix(Experts)), type = c("spearman"))
res2
library("PerformanceAnalytics")
chart.Correlation(Experts, histogram=TRUE, pch=19, method="spearman", exact=FALSE)

所以这给了我图表,正如我所要求的,但也给了我警告消息:

In cor.test.default(as.numeric(x), as.numeric(y), method = method) :
  Cannot compute exact p-value with ties

我已经添加了exact=FALSE 参数,这是我在论坛上找到的所有内容,以消除此警告,但这不起作用。我相信它甚至似乎根本不认识exact=FALSE 论点?有谁知道另一种方法来摆脱这个警告?

r correlation performanceanalytics
1个回答
0
投票

您是否也尝试过在之前的 2 次相关性计算中添加精确=False?

res <- cor(Experts, method="spearman",exact=FALSE)
res2 <- rcorr((as.matrix(Experts)), type = c("spearman"),exact=FALSE)
© www.soinside.com 2019 - 2024. All rights reserved.