我注意到dunn.test软件包和DescTools(第182页)提供了Dunn检验,用于事后成对的多重比较程序,适用于拒绝Kruskal-Wallis检验的情况。
它们之间有什么区别?
我已经对我的数据进行了两项测试,并使用Bonferroni校正,结果却大不相同:
DunnTest(mydata$value, mydata$group, method = "bonferroni") #Desc Tools package
Dunn's test of multiple comparisons using rank sums : bonferroni
mean.rank.diff pval
B-A 50.721785 0.0010 ***
C-A -51.035983 0.1361
D-A -8.332766 1.0000
C-B -101.757768 2.4e-06 ***
D-B -59.054552 3.2e-05 ***
D-C 42.703216 0.3202
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> prg_diff <- dunnTest(mydata$value~ mydata$group, kw = TRUE, method = "bonferroni") # bonferroni adjustment for multiple testing
> prg_diff
Dunn (1964) Kruskal-Wallis multiple comparison
p-values adjusted with the Bonferroni method.
Comparison Z P.unadj P.adj
1 A - B -3.7648546 1.666460e-04 9.998760e-04
2 A - C 2.2788603 2.267537e-02 1.360522e-01
3 B - C 5.0702968 3.971958e-07 2.383175e-06
4 A - D 0.5096668 6.102849e-01 1.000000e+00
5 B - D 4.5489775 5.390721e-06 3.234432e-05
6 C - D -1.9319401 5.336689e-02 3.202014e-01
> print(prg_diff,dunn.test.results=TRUE)
Kruskal-Wallis rank sum test
data: x and g
Kruskal-Wallis chi-squared = 45.1676, df = 3, p-value = 0
Comparison of x by g
(Bonferroni)
Col Mean-|
Row Mean | A B C
---------+---------------------------------
B | -3.764854
| 0.0010*
|
C | 2.278860 5.070296
| 0.1361 0.0000*
|
D | 0.509666 4.548977 -1.931940
| 1.0000 0.0000* 0.3202
alpha = 0.05
Reject Ho if p <= alpha
为什么结果不同?
DunnTest
如何产生pval
= 1.000?
如何解释结果?