How H is calculated
All values are ranked together, ties get the average rank, and Rᵢ is the rank sum of group i. Under the null hypothesis H follows a chi-square distribution with k − 1 degrees of freedom. The tie correction (t = size of each tied block) is the same one R's kruskal.test applies. Epsilon² runs from 0 to 1. As a rough guide, .01 is small, .08 medium and .26 large; these mirror the η² benchmarks.
Dunn's post-hoc test
Dunn (1964) compares mean ranks from the pooled ranking, z = (R̄ᵢ − R̄ⱼ) / √[(N(N+1)/12 − Σ(t³−t)/(12(N−1))) (1/nᵢ + 1/nⱼ)]. This matches FSA::dunnTest and dunn.test in R. Running separate Mann–Whitney tests instead would rank each pair on its own and ignore the other groups.
Kruskal–Wallis or ANOVA?
With roughly normal data and similar spread, one-way ANOVA (with Welch's F if variances differ) is more powerful and estimates means directly. Use Kruskal–Wallis for ordinal outcomes such as Likert ratings, or small skewed samples. For exactly two groups it gives the same p as the Mann–Whitney U test (normal approximation).
Frequently asked questions
What is the Kruskal–Wallis test used for?
To compare three or more independent groups when the outcome is ordinal, or continuous but clearly non-normal or full of outliers. It is the rank-based alternative to one-way ANOVA and extends the Mann–Whitney U test beyond two groups.
What does a significant Kruskal–Wallis result mean?
That at least one group tends to have higher or lower values than the others. It does not say which; for that, run Dunn’s post-hoc test with a Bonferroni or Holm correction, as shown above.
Does Kruskal–Wallis compare medians?
Only if all groups have distributions of the same shape and spread. Otherwise it tests whether values in one group tend to be larger (stochastic dominance), so report mean ranks alongside the medians.
What are the assumptions of the Kruskal–Wallis test?
Independent observations, an outcome that is at least ordinal, and groups that are independent of each other. It does not assume normality or equal variances. For repeated measurements on the same people use the Friedman test instead.
How do I report Kruskal–Wallis in APA style?
Give the medians, then H with degrees of freedom and N, the p-value and an effect size: “H(2, N = 14) = 0.77, p = .680, ε² = .06.” Follow with Dunn’s pairwise comparisons if H is significant.
Bonferroni or Holm for Dunn’s test?
Holm controls the family-wise error rate just as strictly as Bonferroni but is uniformly more powerful, so it is the better default. Bonferroni is simpler to explain and still widely requested by reviewers.