非參數(shù)檢驗(yàn)適用于非正態(tài)數(shù)據(jù)
- 存在兩個(gè)以上的組,譬如三組蹋岩,檢驗(yàn)總體上這些組是否存在顯著差異增蹭,使用 Kruskal-Wallis 檢驗(yàn),可以得到多組之間是否存在差異(p<0.05)午乓。該檢驗(yàn)可以進(jìn)一步計(jì)算差異的效應(yīng)值E2
R包rstatix::kruskal_effsize 函數(shù)可以計(jì)算該值站宗。
The eta-squared estimate(E2)assumes values from 0 to 1 and multiplied by 100 indicates the percentage of variance in the dependent variable explained by the independent variable. The interpretation values commonly in published litterature are: 0.01- < 0.06 (small effect), 0.06 - < 0.14 (moderate effect) and >= 0.14 (large effect).
- Kruskal-Wallis 檢驗(yàn) 僅僅能夠鑒定組間是否存在顯著差異,想要進(jìn)一步探究那些組之間存在顯著差異益愈,則需要進(jìn)一步使用 Wilcoxon tests進(jìn)行兩兩比較梢灭,見wilcox_test {rstatix}。 不多贅述。
3敏释。 ggplot2 中可以為上述兩種檢驗(yàn)添加顯著性標(biāo)記等库快,
#### for Wilcoxon tests
ggsignif::geom_signif(comparisons = list(c("basal","q0.95.inter"),
c("basal","q0.95.top"),
c("q0.95.inter","q0.95.top")),# 設(shè)置需要比較的組
map_signif_level = T, #是否使用*顯示
test = wilcox.test, ##計(jì)算方法
y_position = c(1.8,2,2.4),#圖中橫線位置設(shè)置
tip_length = c(c(0.05,0.05),
c(0.05,0.05),
c(0.05,0.05)),#橫線下方的豎線設(shè)置
size=0.8,color="black")
#### for Kruskal-Wallis tests
ggpubr::stat_kruskal_test(label.x = 1, label.y = 2, hjust = 0)
REF:
Kruskal-Wallis Test in R: The Ultimate Guide - Datanovia
Add Kruskal-Wallis Test P-values to a GGPlot — stat_kruskal_test ? ggpubr (datanovia.com)