Kruskal-Wallis H test
Also known as: Kruskal-Wallis H test, one-way ANOVA on ranks, Kruskal-Wallis one-way analysis of variance, Kruskal-Wallis Testi
The Kruskal-Wallis H test is a nonparametric hypothesis test that compares three or more independent groups to decide whether their distributions (typically their medians) differ. Introduced by William Kruskal and W. Allen Wallis in 1952, it works on ranks rather than raw values and is the distribution-free counterpart to one-way ANOVA.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
+6 more
When to use it
Use it to compare three or more independent groups on an outcome that is at least ordinal, when the normality assumption of one-way ANOVA is untenable. Each observation must belong to exactly one group, observations must be independent, and the groups should have similar distribution shapes for the result to be read as a comparison of medians. A sample of at least 15 observations is recommended; with very few observations per group the chi-square approximation and statistical power both weaken, and a permutation test is a safer fallback.
Strengths & limitations
- Makes no normality assumption, so it tolerates skewed or ordinal data where ANOVA fails.
- Rank-based, which makes it resistant to outliers and extreme values.
- Extends the two-group Mann-Whitney U logic naturally to three or more groups.
- It is an omnibus test: a significant result does not identify which groups differ without post-hoc testing.
- When group distribution shapes differ markedly it tests stochastic dominance rather than medians, complicating interpretation.
- Generally less powerful than one-way ANOVA when the data genuinely are normal.
Frequently asked
How is it different from one-way ANOVA?
One-way ANOVA compares group means and assumes the data are normally distributed with equal variances. The Kruskal-Wallis test compares the ranks of the values instead, so it makes no normality assumption and is the recommended choice when the data are ordinal, skewed, or contain outliers.
Does it compare medians or distributions?
Strictly, it tests whether the groups come from the same distribution. When the groups share a similar distribution shape, a significant result can be interpreted as a difference in medians; when the shapes differ, it indicates stochastic dominance rather than a clean median difference.
It is significant — which groups differ?
Kruskal-Wallis is an omnibus test, so it only tells you that at least one group differs. To locate the differences, run post-hoc pairwise comparisons such as Dunn's test with a Bonferroni or Holm correction, and report an effect size like epsilon-squared or eta-squared.
How large a sample do I need?
At least 15 observations overall is a sensible minimum. With fewer observations per group the H statistic becomes unreliable and the test loses power; in that situation a permutation test is a more dependable alternative.
Sources
- Kruskal, W. H. & Wallis, W. A. (1952). Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association, 47(260), 583–621. DOI: 10.1080/01621459.1952.10483441 ↗
How to cite this page
ScholarGate. (2026, June 1). Kruskal-Wallis H test. ScholarGate. https://scholargate.app/en/statistics/kruskal-wallis
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Dunn TestStatistics↔ compare
- Friedman testStatistics↔ compare
- Mann-Whitney U testStatistics↔ compare
- One-way ANOVAStatistics↔ compare
- Permutation TestStatistics↔ compare