使用Spearman Rho系数比较排名
我想将方法2、3和4的排名结果与方法1进行比较。在这方面,我想使用Spearman Rho系数。我还想知道方法2、3和4与方法1之间是否存在显着关系。
database<-structure(list(
Method1 = c(1L, 10L, 7L, 8L, 9L, 6L, 5L, 3L, 4L, 2L), Method2 = c(1L,
8L, 6L, 7L, 10L, 9L, 4L, 2L, 5L, 3L), Method3 = c(1L,
10L, 7L, 8L, 9L, 6L, 4L, 2L, 3L, 5L), Method4 = c(1L,
9L, 6L, 7L, 10L, 8L, 5L, 3L, 2L, 4L)), class = "data.frame", row.names = c(NA,
10L))
> database
Method1 Method2 Method3 Method4
1 1 1 1 1
2 10 8 10 9
3 7 6 7 6
4 8 7 8 7
5 9 10 9 10
6 6 9 6 8
7 5 4 4 5
8 3 2 2 3
9 4 5 3 2
10 2 3 5 4
I would like to compare the ranking results of Methods 2, 3 and 4 with Method 1. In this regard, I would like to use the Spearman Rho coefficient. I would also like to know if a significant relationship between the results of methods 2, 3 and 4 with method 1. So how to do this?
database<-structure(list(
Method1 = c(1L, 10L, 7L, 8L, 9L, 6L, 5L, 3L, 4L, 2L), Method2 = c(1L,
8L, 6L, 7L, 10L, 9L, 4L, 2L, 5L, 3L), Method3 = c(1L,
10L, 7L, 8L, 9L, 6L, 4L, 2L, 3L, 5L), Method4 = c(1L,
9L, 6L, 7L, 10L, 8L, 5L, 3L, 2L, 4L)), class = "data.frame", row.names = c(NA,
10L))
> database
Method1 Method2 Method3 Method4
1 1 1 1 1
2 10 8 10 9
3 7 6 7 6
4 8 7 8 7
5 9 10 9 10
6 6 9 6 8
7 5 4 4 5
8 3 2 2 3
9 4 5 3 2
10 2 3 5 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您需要这样的东西,其中使用“ spearman”
方法
:输出:
for p-value:输出:输出:
输出:
Maybe you want something like this where you extract the estimate of the
cor.test
using the "spearman"method
:Output:
For p-value:
Output:
在
sapply
在其余列上循环。In an
sapply
loop over the remaining columns .在上使用
总结
Using
summarise
withacross