本文展示了r语言中如何进行Spearman等级相关分析的例子。
本文展示了r语言中如何进行Spearman等级相关分析的例子。
例
Spearman等级相关的例子
### --------------------------------------------------------------
### Spearman等级相关检验,军舰鸟例子
Data = read.table(textConnection(Input),header=TRUE)
cor.test( ~ Pitch + Volume,
data=Data,
method = "spearman",
continuity = FALSE,
conf.level = 0.95)
Spearman's rank correlation rho
S = 1708.382, p-value = 0.0002302
sample estimates:
rho
-0.7630357
数据简单图
plot(Pitch ~ Volume,
data=Data,
pch=16)
怎么做测试
Spearman等级相关的例子
Spearman's rank correlation rho
S = 1111.908, p-value = 0.1526
rho
-0.3626323