Kruskal-Wallis Test Calculator: Compare Three Groups Without Assuming Normality
A rank-based test for three groups, when the data is not normal.
Engineering student calculators
Free textbook calculators with every step shown, so you can check your own working. Pick one, type in your numbers and see the formulas worked out. Or switch to Ask a question for an explained answer. No account needed.
Calculated from standard textbook formulas, with every step shown. The formulas are fixed, so the working does not need checking: what matters is the numbers you type in. Use these calculators only if you are competent to choose the inputs (loads, material strength, dimensions, supports) and check your units and assumptions. For learning and checking your own working: design and sign-off are for a qualified engineer. Drafting Central does not store the numbers you type.
How this calculator works
Enter the number of values and the values for each of the three groups.
Enter the significance level.
The calculator ranks all the values and gives H, the p-value, the medians and the effect size.
Formulas used
- H = \frac{12}{N(N + 1)}\sum\frac{R_i^2}{n_i} - 3(N + 1)
- H_c = \frac{H}{1 - \sum(t^3 - t)/(N^3 - N)}
- df = k - 1
Worked example
With the default numbers in the calculator above:
- Median of each group: 7, 10.5 and 14.5
- Sum of the ranks of each group (all 18 values ranked together from smallest, tied values share the average rank): 21.5, 58.5 and 91
- Mean rank of each group: 3.5833, 9.75 and 15.167
- The Kruskal-Wallis statistic H before the tie correction: 14.1433
- Correction for tied values: 0.993808
- H after the tie correction: 14.2314
- Degrees of freedom: the number of groups minus 1: 2
- p-value from the chi-square distribution: 0.00081225
- Effect size (epsilon squared: the share of the variation in the ranks due to the groups): 0.8371
Change the numbers in the calculator to see the full working, every step, for your own case.
Common questions
When do I use the Kruskal-Wallis test?
To compare three or more independent groups when the data is not normally distributed, the samples are small or the data are ranks.
How is it related to ANOVA?
It is the rank-based version of the one-way ANOVA.
What do I do after a significant result?
Use pairwise tests such as Mann-Whitney, with an adjustment for the number of comparisons, to find which groups differ.
Related calculators
Got a question about this? Ask an engineering question and get a plain-language answer with references.
Further reading: Any statistics text (non-parametric tests, the Kruskal-Wallis test).
Need a calculator we do not have?
Embed this calculator on your own page
Copy this code into your page. The calculator runs inside the frame and links back to Drafting Central.
Need this drawn, designed or checked?
Drafting Central is a mechanical engineering and drafting business working with customers across Australia and around the world. A calculator gives you the numbers; we can turn them into drawings and designs.
Need help with a real project?
Talk to Drafting Central →