🔧 tool

相关软件(R代码)

```r # Wilcoxon符号秩检验(配对) before <- c(143, 164, 129, 151, 171, 153, 134, 128, 164, 154) after <- c(147, 166, 133, 142, 155, 153, 142, 143, 136, 151) wilcox.test(before, after, paired = TRUE) # Mann-Whi...

📖 定义

# Wilcoxon符号秩检验(配对)
before <- c(143, 164, 129, 151, 171, 153, 134, 128, 164, 154)
after <- c(147, 166, 133, 142, 155, 153, 142, 143, 136, 151)
wilcox.test(before, after, paired = TRUE)
# Mann-Whitney U检验(独立样本)
group1 <- c(15, 18, 22, 19, 25, 20, 21, 17)
group2 <- c(12, 14, 16, 13, 15, 18, 11, 14)
wilcox.test(group1, group2)  # 默认exact=TRUE当n<50
# Kruskal-Wallis检验
# 三组小鼠的跑迷宫时间
strain_A <- c(12, 15, 18, 14, 16, 13)
strain_B <- c(22, 25, 19, 24, 21, 23)
strain_C <- c(30, 28, 32, 29, 31, 27)
kruskal.test(list(A = strain_A, B = strain_B, C = strain_C))
# 事后检验:Dunn检验(带Bonferroni校正)
# install.packages("dunn.test")
library(dunn.test)
dunn.test(c(strain_A, strain_B, strain_C), 
          g = factor(rep(c("A", "B", "C"), each = 6)), method = "bonferroni")