Calculate Spearman correlation and corrected p

I am calculating spearman correlation between x and y variables (both datasets have some values that are equal), using R. I used:

cor.test(x, y, method= "spearman")

And I get a warning message:

Cannot compute exact p-value with ties

My x data it's like: 0.84, 0.84, 0.07, 0.173 My y data it's like: 6, 2, 4, 2

I would like to solve this problem. I read these two questions:

  • Spearman correlation and ties
  • Is Spearman's cor.test in R tie corrected or not?
  • But I still cannot solve my problem. Can you help me? I understand that maybe I could use kendall instead of spearman although, using the same function (changing "spearman" to "Kendall") I get the same warning message. I also saw an ans I would like to calculate spearman correctly is this possible or not even with ties? Thank you very much for your help.

    链接地址: http://www.djcxy.com/p/57760.html

    上一篇: 标称有序列表中的scipy.stats.spearmanr参数是什么?

    下一篇: 计算Spearman相关性并更正p