Spearman correlation and ties

前端 未结 7 1848
南旧
南旧 2020-12-04 16:45

I\'m computing Spearman\'s rho on small sets of paired rankings. Spearman is well known for not handling ties properly. For example, taking 2 sets of 8 rankings, even if 6 a

7条回答
  •  一个人的身影
    2020-12-04 17:20

    I think exact=FALSE does the trick.

    cor.test(c(1,2,3,4,5,6,7,8), c(0,0,0,0,0,0,7,8), method="spearman", exact=FALSE)
    
        Spearman's rank correlation rho
    
    data:  c(1, 2, 3, 4, 5, 6, 7, 8) and c(0, 0, 0, 0, 0, 0, 7, 8)
    S = 19.8439, p-value = 0.0274
    alternative hypothesis: true rho is not equal to 0
    sample estimates:
          rho 
    0.7637626 
    

提交回复
热议问题