I have to compare three groups. Three measurements using 3 different methods on the same subjects. The variables are not normal, and the measures concern the same people, so dependent samples. I can use Kruskal-Wallis? I can use Wilcoxon post analysis with Bonferroni correction? How can I use the Bonferroni correction in R? Can I have examples?

  • $\begingroup$ I would advise usage of a specific post-hoc test such as Dunn's or Nemenyi test which can be found in PMCMR package. $\endgroup$ – Andrey Kolyadin Feb 17 '17 at 12:28
  • $\begingroup$ Thank you, but for the comparison of the three groups? $\endgroup$ – ANDREA NIGRI Feb 17 '17 at 13:49
  • $\begingroup$ There are no reasons to use post-hoc test for less than 3 groups. Both Dunn's test and Nemenyi test are working perfectly fine with 3 and more groups. $\endgroup$ – Andrey Kolyadin Feb 17 '17 at 13:54
  • $\begingroup$ thank you but my group are 3 $\endgroup$ – ANDREA NIGRI Feb 17 '17 at 14:01

It seems some misunderstanding have arose in comments, so here is an answer.

Why we shouldn't use Wilcoxon test as post-hoc?

Pairwise Wilcox-Mann-whitney test doesn't take into account ranks from Kruskal-Wallis test, it creates it's own. On the other side Dunn's test use group ranking from KW test.

Example with R:

df <- data.frame(val = c(runif(15,  0, 15),
                         runif(15,  0, 15),
                         runif(15, 10, 20)),
                 grp = rep(c('A', 'B', 'C'), each = 15))

kruskal.test(val ~ grp, df)

    Kruskal-Wallis rank sum test

data:  val by grp
Kruskal-Wallis chi-squared = 22.045, df = 2, p-value = 1.633e-05

So Kruskal-Wallis test tells us that there is statistically significant differences between groups. But we need to run Dunn's test to know between which pairs of group we have difference .

posthoc.kruskal.dunn.test(val ~ grp, df)

    Pairwise comparisons using Dunn's-test for multiple 
                         comparisons of independent samples 

data:  val by grp 

  A       B      
B 0.96674 -      
C 0.00013 0.00013

P value adjustment method: holm 

And we can conclude that group C is different from A and B.


Okey, I missed part about dependent samples.

In case of dependent samples Friedman test with appropriate post-hoc (Conover test in PMCMR for example) should be used. But general approach (just with correct tests) I showed above is still applicable.

  • $\begingroup$ ok but I know that the Kruskal wallis method is not used when the samples are dependent $\endgroup$ – ANDREA NIGRI Feb 17 '17 at 15:50
  • $\begingroup$ the Friedman test can be applied in the case of groups with different numerosity? $\endgroup$ – ANDREA NIGRI Feb 17 '17 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.