Data and statistics · cheat sheet Kruskal-Wallis test A test of whether three or more independent groups differ, using ranks instead of averages: the rank-based version of one-way ANOVA.
Common practice 4 steps Used by Process Improvement Specialist
What it is Kruskal-Wallis ranks all values from several groups together and tests whether the groups' average ranks differ.
When to use it When comparing several groups with skewed or ordinal data.
Why it works It's the ANOVA alternative for skewed data.
Do Box plots show which group differs. Don't Using it on related groups (use Friedman). Forgetting to say which group is different. Step by step Rank all
Average rank per group
H statistic
p-value Chi-square, groups − 1.
Worked example The situation. Waiting times (minutes) at three clinics, 6 patients each.
Medians 24.5, 34 and 25.5. The result. Clinic 2 was understaffed at lunch.
Part Value H 10.41 Degrees of freedom 2 p-value 0.005
Filled in for: Waiting times (minutes) at three clinics, 6 patients each.
Copy this structure, or print the blank version and fill it in by hand. Average rank per group ______ H ______ p ______
Before you use it: check these Check If it fails Independent groups Use the Friedman test when the same blocks appear in every group At least about 5 values per group Combine groups or collect more
How to do it with real data The full calculation, as it happens in the story: the data, every step, how to read the result, and the spreadsheet functions to do it yourself.
Worked example with real dataChecking the Monday effect without assuming normal data
From Day 32: Checking with ranks and medians of the Process Improvement Specialist story
The same 60 waits by day, tested on ranks and on medians instead of averages.
Waits by the day of the first request 0 10 20 30 40 Monday: median 14, quartiles 11.25 and 20, n = 18 14 Monday Tuesday: median 5, quartiles 3 and 6.25, n = 12 5 Tuesday Wednesday: median 10.5, quartiles 5 and 14.75, n = 10 10.5 Wednesday Thursday: median 6, quartiles 4.25 and 9.25, n = 10 6 Thursday Friday: median 8, quartiles 5.5 and 11.75, n = 10 8 Friday
Step by step Kruskal-Wallis: rank everything rank all 60 waits from 1 to 60, ties sharing the average rank Compare average ranks do the days' average ranks differ more than chance would give? = H = 19.66 Kruskal-Wallis: p-value chi-square with 4 degrees of freedom = 0.0006 Mood's median: overall median median of all 60 = 10 days Count above and below Monday: 15 above, 3 at or below · Tuesday: 2 and 10 · Wednesday: 5 and 5 · Thursday: 1 and 9 · Friday: 4 and 6 Mood's median: p-value chi-square on that table = 0.0006
Request Day of first request Wait (days) R01 Friday 12 R02 Wednesday 13 R03 Monday 12 R04 Monday 28 R05 Friday 11 R06 Monday 12 R07 Thursday 16 R08 Thursday 7 R09 Tuesday 3 R10 Monday 4 R11 Tuesday 4 R12 Tuesday 10 R13 Wednesday 4 R14 Tuesday 17 R15 Tuesday 5 R16 Wednesday 8 R17 Thursday 5 R18 Tuesday 5 R19 Friday 5 R20 Monday 20 R21 Thursday 3 R22 Wednesday 15 R23 Wednesday 5 R24 Friday 9 R25 Tuesday 5 R26 Wednesday 5 R27 Wednesday 15 R28 Monday 15 R29 Wednesday 14 R30 Friday 13 R31 Monday 18 R32 Friday 16 R33 Tuesday 3 R34 Wednesday 5 R35 Monday 10 R36 Friday 7 R37 Thursday 6 R38 Thursday 10 R39 Thursday 10 R40 Tuesday 5 R41 Friday 5 R42 Thursday 4 R43 Friday 5 R44 Thursday 6 R45 Friday 7 R46 Monday 11 R47 Monday 11 R48 Tuesday 3 R49 Monday 13 R50 Monday 26 R51 Monday 12 R52 Monday 22 R53 Monday 27 R54 Wednesday 18 R55 Thursday 4 R56 Tuesday 14 R57 Monday 20 R58 Tuesday 3 R59 Monday 6 R60 Monday 19
How to read the result Both tests agree with ANOVA: Monday requests wait longer. Kruskal-Wallis uses ranks, Mood's median only counts above or below the median, so it's less powerful but very robust to extreme values.
What it led to Root cause confirmed: Monday demand (30% of the week's requests) meets the same capacity as any other day.
Do it in a spreadsheet Ranks =RANK.AVG(C2,$C$2:$C$61,1)Average rank by day =AVERAGEIFS(D2:D61,B2:B61,"Monday")Mood's table =COUNTIFS(B2:B61,"Monday",C2:C61,">10")Chi-square p-value =CHISQ.TEST(observed,expected)
Try it yourself: Which of the two tests would you trust more if a few waits were extremely long (say 80 days)? Mood's median: it only asks whether each value is above or below the median, so extreme values can't pull it. Kruskal-Wallis is also robust but uses more information.
In the roles How a Process Improvement Specialist uses itWaits by weekday: H = 19.66, p = 0.0006.
Questions people ask Kruskal-Wallis or Mood's median? Kruskal-Wallis is more powerful; Mood's is more robust to extreme values.
← All techniques and tools