(斯皮尔曼相关性系数)
斯皮尔曼相关性系数,通常也叫斯皮尔曼秩相关系数。“秩”,可以理解成就是一种顺序或者排序,那么它就是根据原始数据的排序位置进行求解,这种表征形式就没有了求皮尔森相关性系数时那些限制
> n <- 10
> x <- rnorm(n)
> y <- rnorm(n)
> cor(x,y)
[1] -0.4132864
> cor.test(x,y)
Pearson's product-moment correlation
data: x and y
t = -1.2837, df = 8, p-value = 0.2352
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.8275666 0.2924366
sample estimates:
cor
-0.4132864
网友评论