Spearman correlation and ties

前端 未结 7 1827
南旧
南旧 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:16

    I was having a similar problem and by reading the answers here and the help file on R I saw that, when you have ties, you have to add the parameter exact = FALSE) to the cor.test() function. By adding this, it does not try to calculate an exact P value, but instead "the test statistic is the estimate scaled to zero mean and unit variance, and is approximately normally distributed". The result, in my case, was exactly the same, but without the warning about ties.

    cor.test(x, y, method = "spearm", exact = FALSE)
    

提交回复
热议问题