# R语言的各种检验

• A+

### 1、W检验（Shapiro–Wilk (夏皮罗–威克尔 ) W统计量检验)

检验数据是否符合正态分布，R函数：shapiro.test().

结果含义：当p值小于某个显著性水平α(比如0.05)时，则认为

### 2、K检验(经验分布的Kolmogorov-Smirnov检验)

R函数:ks.test(),如果P值很小，说明拒绝原假设，表明数据不符合F(n,m)分布。

### 3、相关性检验：

R函数：cor.test()

cor.test(x, y,
alternative = c("two.sided", "less", "greater"),
method = c("pearson", "kendall", "spearman"),
exact = NULL, conf.level = 0.95, ...)

### 4、T检验

t.test()

t.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, ...)

### 5、正态总体方差检验

t.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, ...)

### 6、二项分布总体假设检验

binom.test(x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95)

### 7、Pearson 拟合优度χ2检验

chisq.test(x, y = NULL, correct = TRUE,
p = rep(1/length(x), length(x)), rescale.p = FALSE,
simulate.p.value = FALSE, B = 2000)

原假设H0：X符合F分布。

p-值小于某个显著性水平，则表示拒绝原假设，否则接受原假设。

### 8、Fisher精确的独立检验：

fisher.test(x, y = NULL, workspace = 200000, hybrid = FALSE,
control = list(), or = 1, alternative = "two.sided",
conf.int = TRUE, conf.level = 0.95)

### 9、McNemar检验：

mcnemar.test(x, y = NULL, correct = TRUE)

### 10、秩相关检验

cor.test(x, y,
alternative = c("two.sided", "less", "greater"),
method = "spearman", conf.level = 0.95, ...)

### 11、Wilcoxon秩检验

wilcox.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, exact = NULL, correct = TRUE,
conf.int = FALSE, conf.level = 0.95, ...)

• x-play 0

怎么分享啊