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.
Results
- 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).
| Group | n | Rank sum | Mean rank |
|---|---|---|---|
| Normal | 5 | 36 | 7.2 |
| Airway disease | 4 | 36 | 9 |
| Asbestosis | 5 | 33 | 6.6 |
| Comparison | z | p-value | Holm-adjusted p |
|---|---|---|---|
| Normal vs Airway disease | -0.641427 | 0.5212 | 1 |
| Normal vs Asbestosis | 0.226779 | 0.8206 | 1 |
| Airway disease vs Asbestosis | 0.855236 | 0.3924 | 1 |
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
- One-way ANOVA calculator with Tukey HSDCompare the means of two or more groups: ANOVA table, η² and ω², Welch’s ANOVA, and Tukey–Kramer pairwise intervals with adjusted p-values.
- T-test calculatorOne-sample, independent two-sample (Welch and pooled) and paired t-tests from raw data or summary statistics, with confidence intervals and Cohen’s d.
- Effect size calculatorCohen’s d, Hedges’ g and Glass’s Δ from group means, or odds ratio, risk ratio and risk difference from a 2×2 table, each with confidence intervals.
- Standard deviation calculatorPaste data to get the standard deviation (sample and population), variance, mean, median, mode, quartiles with the method stated, IQR, outliers, skewness and kurtosis.
- P-value calculatorFind the p-value and critical values for a z, t, chi-square or F test statistic, one- or two-tailed, accurate far into the tails.