Non-parametric alternative to one-way ANOVA. Compare three or more independent groups without assuming normal distribution. Results include H statistic, p-value, and pairwise comparisons.
The Kruskal-Wallis H test is a rank-based non-parametric test used to determine whether there are statistically significant differences between three or more independent groups. It extends the Mann-Whitney U test to more than two groups and serves as the non-parametric alternative to one-way ANOVA. Developed by William Kruskal and W. Allen Wallis in 1952, it ranks all observations regardless of group membership and tests whether the rank distributions differ across groups.
Use the Kruskal-Wallis H test when you want to compare three or more independent groups and one or more of the following conditions apply: your data are measured on an ordinal scale (e.g., Likert-type items), the assumption of normality is violated, your sample sizes are very small, or your data contain outliers that would distort parametric results. It is commonly used in medical research, psychology, education, and quality control studies.
| Feature | Kruskal-Wallis H | One-Way ANOVA |
|---|---|---|
| Type | Non-parametric | Parametric |
| Data level | Ordinal or continuous | Continuous (interval/ratio) |
| Normality required | No | Yes (or large n) |
| Compares | Rank distributions | Means |
| Effect size | η²H | η² |
| Post-hoc test | Dunn's test | Tukey / Bonferroni |
A researcher compares satisfaction ratings (1-10 scale) across three different training programs. Since the ratings are ordinal and the samples are small, a Kruskal-Wallis H test is appropriate.
Program A (n=7)
12, 15, 18, 14, 16, 13, 17
Mdn = 15.0
Program B (n=7)
22, 25, 20, 28, 24, 26, 21
Mdn = 24.0
Program C (n=7)
8, 11, 9, 13, 10, 7, 12
Mdn = 10.0
Results
H(2) = 16.06, p < .001, η²H = 0.78
There was a significant difference among the three programs, with a large effect size. Dunn's post-hoc test with Bonferroni correction revealed significant differences between all pairs.
While the Kruskal-Wallis H test is less restrictive than ANOVA, it still has assumptions that should be verified:
1. Ordinal or Continuous Data
The dependent variable must be measured on at least an ordinal scale (i.e., values can be meaningfully ranked).
2. Independent Groups
The groups must be independent of each other. Each observation belongs to only one group. For related groups or repeated measures, use the Friedman test instead.
3. Independent Observations
Observations within each group must be independent. Repeated measures, clustered, or paired data violate this assumption.
4. Similar Distribution Shape
For interpreting the result as a comparison of medians, all groups should have similarly shaped distributions. If distributions differ in shape, the test compares rank distributions more broadly.
Eta-squared H (η²H) is the effect size measure for the Kruskal-Wallis test. It estimates the proportion of variance in ranks explained by group membership, analogous to η² in ANOVA.
| η²H | Interpretation | Practical Meaning |
|---|---|---|
| < 0.01 | Negligible | Groups are nearly identical in rank |
| 0.01 - 0.06 | Small | Slight differences in rank distributions |
| 0.06 - 0.14 | Medium | Noticeable separation between groups |
| > 0.14 | Large | Strong separation in rank distributions |
According to APA 7th edition guidelines, report the H statistic, degrees of freedom, p-value, effect size, and descriptive statistics (medians and sample sizes) for each group:
Example Report
A Kruskal-Wallis H test indicated a statistically significant difference in satisfaction ratings across the three programs, H(2) = 16.06, p < .001, η²H = .78. Post-hoc pairwise comparisons using Dunn's test with Bonferroni correction revealed that Program B (Mdn = 24.0) scored significantly higher than both Program A (Mdn = 15.0) and Program C (Mdn = 10.0).
Note: Report H to two decimal places, degrees of freedom as an integer, and p to three decimal places. Use p < .001 when the value is below .001. Always include η²H as the effect size measure and follow up with post-hoc results when the omnibus test is significant.
StatMate's Kruskal-Wallis H test calculations have been validated against R (kruskal.test function) and SPSS output. The implementation uses chi-square approximation for the p-value and the jstat library for probability distributions. Tied ranks are handled using the average rank method. All results match R output to at least 4 decimal places.
T-Test
Compare means between two groups
ANOVA
Compare means across 3+ groups
Chi-Square
Test categorical associations
Correlation
Measure relationship strength
Descriptive
Summarize your data
Sample Size
Power analysis & sample planning
One-Sample T
Test against a known value
Mann-Whitney U
Non-parametric group comparison
Wilcoxon
Non-parametric paired test
Regression
Model X-Y relationships
Multiple Regression
Multiple predictors
Cronbach's Alpha
Scale reliability
Logistic Regression
Binary outcome prediction
Factor Analysis
Explore latent factor structure
Repeated Measures
Within-subjects ANOVA
Two-Way ANOVA
Factorial design analysis
Friedman Test
Non-parametric repeated measures
Fisher's Exact
Exact test for 2×2 tables
McNemar Test
Paired nominal data test
Paste from Excel/Sheets or drop a CSV file
Paste from Excel/Sheets or drop a CSV file
Paste from Excel/Sheets or drop a CSV file
Enter your data and click Calculate
or click "Load Example" to try it out