Kruskal-Wallis H Test: The Non-Parametric One-Way ANOVA
What you'll learn: How to compare three or more independent groups when parametric ANOVA assumptions (especially normality) aren't met.
When ANOVA Can't Help You
You've learned that one-way ANOVA compares means across multiple groups, but it requires normality and homogeneity of variance. When these assumptions fail—perhaps your data is severely skewed, has outliers, or is ordinal—the Kruskal-Wallis H test comes to the rescue.
The Core Idea
The Kruskal-Wallis test is the rank-based cousin of one-way ANOVA. Instead of comparing group means directly, it:
- Ranks all observations from smallest to largest across all groups combined (ignoring group membership temporarily)
- Calculates the average rank for each group
- Tests whether these average ranks differ more than you'd expect by chance
Think of it like a footrace where you don't care about actual finish times (means), just the order people crossed the line (ranks). If one team consistently finishes near the front, their average rank will be low—suggesting a real difference.
How It Works
The test produces an H statistic that measures how much the rank sums vary between groups. When group distributions are truly identical, H follows approximately a chi-squared distribution. A large H value (and small p-value) indicates at least one group's distribution differs from the others.
Hypotheses:
- H₀: All groups come from identical distributions
- H₁: At least one group differs in distribution (often interpreted as median differences)
When to Use It
- Three or more independent groups
- Normality assumption violated
- Ordinal data or extreme outliers present
- Sample sizes too small to rely on ANOVA's robustness
Key Takeaway: The Kruskal-Wallis H test extends the Mann-Whitney U test to three or more groups by comparing rank sums instead of raw data, making it the go-to non-parametric alternative when one-way ANOVA assumptions fail.