我的问题是,我已经计算了两个变量之间的Spearman秩相关。有一位审稿人问我,是否可以在p < 0.001的所有系数中也加上检验统计。
下面是一个结果。
> cor.test(pl$data, pl$rang, method= "spearman")
# Spearman's rank correlation rho
data: pl$data and pl$rang
S = 911164.6, p-value = 1.513e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
-0.3347658
检验统计量是否等于 S = 911164.6? Is it OK that it is so big number?Sorry in advance if the question is not very professional but I spend quite some time searching for the answers in the books and on internet. :(Thank you for the help in advance.
是的。?cor.test
帮助页面(在值部分)描述了来自于 cor.test
作为。
A list with class ‘"htest"’ containing the following components:
statistic: 检验统计量的值。
根据该页的例子,我们看到的是
x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8)
(result <- cor.test(x, y, method = "spearman"))
# Spearman's rank correlation rho
# data: x and y
# S = 48, p-value = 0.0968
# alternative hypothesis: true rho is not equal to 0
# sample estimates:
# rho
# 0.6
result$statistic
# S
# 48
该统计数字由以下公式给出 (n ^ 3 - n) * (1 - r) / 6
哪儿 n
的长度 x
和 r <- cor(rank(x), rank(y))
.
我找到的最佳答案是在页面上。Rpubs Spearman Rank Correlation.
这个问题也在 交叉验证 "解读R中Spearman's Rank相关系数输出,什么是'S'?"
虽然论坛la (n ^ 3 - n) * (1 - r) / 6
,是 n
等于变量的样本量和 r
等于计算S统计量的相关系数(rho)是很清楚的,但没有明确解释如何解释结果。我还没有找到一个明确的答案:(