0
tutorials.scrollToStart
Statistical tests

When to Use the Kruskal-Wallis Test vs. ANOVA

4 min read

When to use the Kruskal-Wallis test is the non-parametric version of a familiar decision: when you have three or more groups but the normality assumption for ANOVA cannot be met. It compares rank distributions across groups and is a reliable alternative for small samples or ordinal dependent variables. This guide explains the H statistic, post-hoc follow-ups, and APA reporting.

Free sample chapter

Data Analysis From Survey to Results

Step-by-step guidance for choosing the right test, running it, and writing up APA results - in plain language, not theory. Get the free sample chapter when you join the waitlist.

Key takeaways

  • Use Kruskal-Wallis when comparing 3+ groups on a metric or ordinal DV and normality is violated.
  • It is the non-parametric equivalent of one-way ANOVA — it compares rank distributions, not means.
  • A significant Kruskal-Wallis result requires a post-hoc test (Dunn’s test with Bonferroni correction) to identify which groups differ.
  • Effect size η²H = (H − k + 1) ÷ (N − k), where k = number of groups.
  • Report medians, not means, in your results.

What Is Kruskal-Wallis? Non-Parametric ANOVA Explained

The Kruskal-Wallis H test compares three or more independent groups on a dependent variable without assuming normal distribution. It works by ranking all observations from all groups together, then testing whether the mean ranks differ more than would be expected by chance.

It is the non-parametric equivalent of one-way ANOVA. If ANOVA requires normally distributed data and your data fails this check, Kruskal-Wallis is the appropriate alternative.

Typical thesis example: comparing exam anxiety across three study programmes when Shapiro-Wilk is significant for at least one group.

Kruskal-Wallis vs. ANOVA: Which One to Choose?

The decision tree is straightforward:

ConditionUse this test
3+ groups, metric DV, normality holds in all groupsOne-way ANOVA
3+ groups, metric DV, normality violated in ≥1 group, n < 30Kruskal-Wallis
3+ groups, ordinal DVKruskal-Wallis
3+ groups, n ≥ 30 per group, mild normality violationANOVA (robust with large n)

How to Run Kruskal-Wallis in SPSS: Step-by-Step

SPSS path: Analyze → Nonparametric Tests → Legacy Dialogs → K Independent Samples → move your DV to Test Variable List, grouping variable to Grouping Variable → Define Range → ensure Kruskal-Wallis H is ticked → OK.

  • In the output, read the Test Statistics table:
  • Kruskal-Wallis H statistic
  • Degrees of freedom (df = k − 1)
  • Asymptotic Significance = your p-value

[TIP] For post-hoc pairwise comparisons after a significant Kruskal-Wallis, use Analyze → Nonparametric Tests → Independent Samples → run pairwise comparisons. Alternatively, use Dunn’s test with Bonferroni correction via the new SPSS nonparametric tests interface.

Post-Hoc Tests After a Significant Kruskal-Wallis

A significant Kruskal-Wallis result tells you that at least one group differs — but not which pairs. Run pairwise comparisons with Bonferroni correction:

SPSS (new interface): Analyze → Nonparametric Tests → Independent Samples → Fields tab: move DV and grouping variable → Settings → Customize tests → tick Kruskal-Wallis → Multiple comparisons → All pairwise → Run.

Alternatively, run three separate Mann-Whitney U tests (one for each pair) and apply Bonferroni correction: multiply each p-value by the number of comparisons (3). A corrected p < .05 is significant.

Interpreting the H Statistic and Reporting in APA Format

Effect size η²H = (H − k + 1) ÷ (N − k), where H = Kruskal-Wallis statistic, k = number of groups, N = total sample size. Benchmarks: .01 small, .06 medium, .14 large.

  • Significant:
  • "A Kruskal-Wallis test revealed a significant difference in exam anxiety across study programmes, H(2) = 9.84, p = .007, η²H = .08."
  • Non-significant:
  • "No significant difference in exam anxiety was found across study programmes, H(2) = 2.31, p = .315, η²H = .01."

[INFO] Report medians (Mdn) and interquartile ranges (IQR) for each group when using Kruskal-Wallis, not means and SDs.

Frequently asked questions

When should I use Kruskal-Wallis instead of one-way ANOVA?

â–¾
Use Kruskal-Wallis when you have three or more independent groups and the normality assumption fails in at least one group (Shapiro-Wilk p < .05) with sample sizes below 30 per group. With n ≥ 30 per group, ANOVA is robust to mild normality violations and is generally preferred.

Does Kruskal-Wallis test medians or means?

â–¾
Kruskal-Wallis tests whether the rank distributions of the groups differ — not strictly medians or means. It is sensitive to differences in central tendency, so medians are the appropriate descriptive statistic to report alongside it.

What post-hoc test should I use after a significant Kruskal-Wallis result?

â–¾
Use Dunn’s test with Bonferroni correction, available in SPSS’s new nonparametric tests interface (Analyze → Nonparametric Tests → Independent Samples → Settings → Multiple comparisons → All pairwise). Alternatively, run pairwise Mann-Whitney U tests and apply Bonferroni correction manually.

How do I calculate the effect size for Kruskal-Wallis?

â–¾
Use eta-squared: η²H = (H − k + 1) ÷ (N − k), where H is the test statistic, k is the number of groups, and N is the total sample size. Benchmarks: .01 small, .06 medium, .14 large. Calculate manually from the SPSS output.

Free tool

Not sure which statistical test to use?

Answer 5 quick questions about your research design and get the right test - with an explanation of why - in under two minutes.

Statoria Team

Statistics educators & software developers

We build Statoria to help bachelor and master students get through their thesis data analysis without stress. Our guides are written by researchers with experience in social science statistics and student supervision.

Related guides