Statistics and research

Kruskal–Wallis test calculator

Rank-based one-way analysis for three or more groups: H with tie correction, ε² effect size and Dunn’s pairwise tests with Holm adjustment.

Runs in your browser. What you enter stays on this page and is not uploaded.

Each line is one group. Values separated by spaces or commas.

Results

H0.771429df2p-value0.68ε²0.05934
Kruskal–Wallis H (chi-square approximation)
0.77142857
Degrees of freedom k − 1
2
p-value
0.68
Effect size ε² = H / (n − 1)
0.0593407
Conclusion
No difference in location between the groups is shown (not significant at the 5% level).
Ranks by group
GroupnRank sumMean rank
Normal5367.2
Airway disease4369
Asbestosis5336.6
Dunn’s pairwise comparisons (Holm-adjusted)
Comparisonzp-valueHolm-adjusted p
Normal vs Airway disease-0.6414270.52121
Normal vs Asbestosis0.2267790.82061
Airway disease vs Asbestosis0.8552360.39241

The chi-square approximation is the usual choice; with very small groups (all under 5) treat the p-value as approximate.

Method and limits

How to use it

Put each group on its own line, optionally with a name and colon. The test compares three or more independent groups using ranks — the non-parametric alternative to one-way ANOVA.

Formulas

  • Rank all N values together (average ranks for ties); Ri is the rank sum of group i.
  • H = [12 / (N(N + 1)) Σ Ri²/ni − 3(N + 1)] / [1 − Σ(t³ − t)/(N³ − N)], compared with chi-square on k − 1 df.
  • Effect size ε² = H / (N − 1).
  • Dunn’s test for pairs: z = (R̄i − R̄j) / √((N(N + 1)/12 − Σ(t³ − t)/(12(N − 1))) (1/ni + 1/nj)), with Holm-adjusted p-values.

Assumptions and limits

  • Independent observations; groups with similar distribution shapes if you want to interpret the result as a difference in medians.
  • The chi-square approximation is rough when every group has fewer than 5 values.

Worked example

R’s kruskal.test example (Hollander and Wolfe, mucociliary efficiency in three groups of 5, 4 and 5 subjects): H = 0.771 with 2 df, p = 0.680 — no evidence of a difference.

References

Related tools

Share this page

Remind me to visit Contifield

Adds a repeating reminder to your calendar, titled “Contifield Reminder: Visit www.contifield.com”.