Kruskal-Wallis H Test Calculator | Non-Parametric One-Way ANOVA
Perform the Kruskal-Wallis H test across 2–6 independent groups as a non-parametric alternative to one-way ANOVA. Computes the H statistic, degrees of freedom, chi-square p-value, and pairwise Dunn post-hoc comparisons with Bonferroni correction.
What Is the Kruskal-Wallis H Test Calculator | Non-Parametric One-Way ANOVA?
The Kruskal-Wallis H test is the non-parametric analogue of one-way ANOVA. It tests whether k independent groups come from the same population distribution using ranks. All observations are pooled and ranked together; H measures how much the mean ranks of the groups deviate from what we'd expect under the null hypothesis.
H follows an approximate χ² distribution with k−1 degrees of freedom for groups of 5 or more (or exact tables for smaller groups). When H is significant, the Dunn post-hoc test with Bonferroni correction identifies which specific pairs of groups differ significantly.
Formula
H = (12/(N(N+1))) · Σ(Rᵢ²/nᵢ) − 3(N+1) | df = k−1
Tie correction: H_c = H / (1 − Σ(t³−t)/(N³−N))
p-value from χ²(df) distribution
Effect size: η² = (H − k + 1)/(N − k) | Dunn z = |R̄ᵢ − R̄ⱼ| / √[(N(N+1)/12)(1/nᵢ+1/nⱼ)]
How to Use
- 1
Select the number of groups (2–6) using the dropdown at the top.
- 2
Enter values for each group in the corresponding textarea (comma or newline separated).
- 3
Each group needs at least 2 values; 5 or more per group gives more reliable χ² approximation.
- 4
Click Run H Test to compute the Kruskal-Wallis statistic.
- 5
Read H (corrected for ties), degrees of freedom, and p-value from the summary cards.
- 6
Review the Group Summary table to compare mean ranks across groups.
- 7
For k > 2, check the Dunn Post-hoc table for pairwise comparisons with Bonferroni correction.
Example Calculation
Example 1 — Three teaching methods (n=5 each): Group 1: 12,15,18,14,16. Group 2: 20,22,25,21,23. Group 3: 10,11,13,12,14. After pooling 15 values and ranking, mean ranks are R̄₁=7.6, R̄₂=13.0, R̄₃=3.4. H = 12/(15·16)·(5·7.6²+5·13²+5·3.4²)−48 ≈ 11.1, p ≈ 0.004. Dunn test shows Group 2 vs Group 3 is significant after Bonferroni.
Example 2 — Two groups (equivalent to Mann-Whitney): With k=2, the Kruskal-Wallis test is mathematically equivalent to the Mann-Whitney U test. H = z² and p-values match within rounding. Use Mann-Whitney for two groups as it also provides effect size r and the U statistic.
Understanding Kruskal-Wallis H Test | Non-Parametric One-Way ANOVA
Kruskal-Wallis vs One-Way ANOVA
| Property | Kruskal-Wallis | One-Way ANOVA |
|---|---|---|
| Distribution | Non-parametric (rank-based) | Parametric (assumes normality) |
| Data type | Ordinal or continuous | Continuous |
| Test statistic | H (chi-squared approx.) | F statistic |
| Effect size | η² from H | η² from SS ratio |
| Post-hoc test | Dunn + Bonferroni | Tukey HSD, Scheffé |
| Sensitivity to outliers | Resistant | Sensitive |
| Relative power (normal data) | ~95.5% of ANOVA | 100% baseline |
η² Effect Size Benchmarks
| η² value | Classification | Meaning |
|---|---|---|
| < 0.01 | Negligible | Group membership explains very little rank variability |
| 0.01 – 0.06 | Small | Detectable effect; modest practical importance |
| 0.06 – 0.14 | Medium | Meaningful group differences; practically relevant |
| > 0.14 | Large | Strong effect; clearly different group distributions |
Post-hoc Testing Guidance
- ▸Only run post-hoc tests after a significant overall H — running them on a non-significant H increases false discovery rate.
- ▸Bonferroni correction is conservative; with 6 groups (15 pairs) the adjusted α per test is 0.05/15 = 0.0033.
- ▸Dunn test compares mean ranks, not raw medians — interpretations should reference ranks or relative ordering.
- ▸For unequal group sizes the Dunn z formula automatically adjusts: larger groups reduce standard error.
- ▸Report both raw and Bonferroni-adjusted p-values so readers can apply alternative corrections (e.g., Holm).
- ▸Pairwise comparisons after a significant H are exploratory, not confirmatory — treat results as hypothesis-generating.
Frequently Asked Questions
When should I use Kruskal-Wallis instead of one-way ANOVA?
What does a significant H tell me?
What is the Bonferroni correction in the Dunn test?
What is η² (eta-squared) effect size for Kruskal-Wallis?
How does the tie correction work?
You Might Also Like
Explore 360+ Free Calculators
From math and science to finance and everyday life — all free, no account needed.