STATISTICAL METHODS · BEGINNER GUIDE
ANOVA vs Kruskal–Wallis: How to Choose
Compare one-way ANOVA with Kruskal–Wallis by matching the method to the outcome, group design and question.
Quick answer: One-way ANOVA compares group means under a model for the outcome and its errors. Kruskal–Wallis compares rank distributions across independent groups; it is not automatically a test of medians unless the group distributions have a suitable common shape.
What this method answers
The methods answer different questions. ANOVA uses numeric distances from means. Kruskal–Wallis ranks pooled observations, which can be helpful for ordinal outcomes or severe departures, but a rank result may reflect changes in spread or shape as well as location.
Choose based on the outcome scale, design and estimand you care about—not by running both and selecting the smaller p-value. For repeated observations, neither independent-groups version respects the pairing without a different model.
Before running a calculation, write down the population and the exact quantity you want to estimate. A method name alone does not define the question, the comparison or the assumptions.
Steps to follow
- Decide whether the measurement is continuous, ordinal or a rating scale.
- Check whether groups are independent or the same participants are measured repeatedly.
- State whether the target is a mean, location shift or overall rank distribution.
- Choose the method before comparing p-values and plan follow-up comparisons.
Keep a record of exclusions, recoding decisions and software settings. That makes the analysis easier to check and repeat.
Worked example
Three independent classes receive satisfaction ratings from 1 to 5. The invented observations are mostly ordered categories, so comparing rank patterns may align better with the measurement scale than treating every one-point step as equal.
| Class A ratings | Class B ratings | Class C ratings |
|---|---|---|
| 1, 2, 3 | 2, 3, 4 | 3, 4, 5 |
Kruskal–Wallis pools the nine values and assigns ranks, including tied ranks. The class rank sums—not a difference between numeric means—feed its test statistic. A real p-value requires the full observations and tie correction.
Interpret the result carefully
A significant result indicates evidence that the group rank distributions are not all alike. It does not identify which groups differ or guarantee that only their medians changed.
Limit to keep in mind: Small samples, many ties and differently shaped distributions complicate interpretation. For repeated measures, use a paired or repeated-measures method designed for the actual data structure.
When reporting an analysis, include the sample size, estimate, units and uncertainty. Explain why the method fits the sampling and measurement design. Separate planned tests from exploratory checks, and avoid saying that association proves a cause.
Frequently asked questions
Does Kruskal–Wallis compare medians?
Not in every case. It compares rank distributions; a median interpretation needs similarly shaped distributions.
Should I use it whenever data are non-normal?
No. Consider the outcome, design, sample size, outliers and target quantity. A robust or transformed model may fit the question better.
Can I use it with paired data?
The standard test assumes independent groups. Use a repeated-measures or paired alternative for matched observations.
What does a significant result tell me?
At least one group’s rank distribution differs; it does not identify the pair or measure practical size.