Kruskal-Wallis Test Calculator
Enter data for 2 to 4 independent groups to perform the Kruskal-Wallis H test, the non-parametric alternative to one-way ANOVA. No normality assumption required.
What is the Kruskal-Wallis Test?
The Kruskal-Wallis test is a rank-based non-parametric test for comparing distributions across two or more independent groups. It extends the Mann-Whitney U test to more than two groups and is the non-parametric counterpart to one-way ANOVA.
Formula:
H = (12 / (N(N+1))) x Σ(Rj²/nj) - 3(N+1)
Where N = total observations, Rj = sum of ranks in group j, nj = size of group j.
How it works:
- Combine all groups and rank all values together
- Handle ties by assigning the average rank
- Sum the ranks within each group
- Compute H from the rank sums
- Compare H to a chi-square distribution with (k-1) degrees of freedom
When to use Kruskal-Wallis:
- Your data does not meet ANOVA's normality assumption
- You have ordinal data or ranked data
- Sample sizes are small or unequal
- Your data has outliers that would distort parametric tests
If H is significant, use post-hoc pairwise Mann-Whitney tests (with a Bonferroni correction) to find which groups differ.