首页 文章

Spearman等级相关性的检验统计量

提问于
浏览
0

我的问题是我计算了两个变量之间的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 ?它是如此之大的数字可以吗?如果问题不是很专业,请提前抱歉,但我花了很长时间在书本和互联网上搜索答案 . :(谢谢你的帮助提前 .

1 回答

  • 3

    是 . ?cor.test 帮助页面(在“值”部分中)描述了 cor.test 的返回值:

    包含以下组件的类“htest”的列表:
    统计:测试统计的值 .

    我们看到,调整该页面上的示例

    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 给出,其中 nxr <- cor(rank(x), rank(y)) 的长度 .

相关问题