Kruskal-Wallis Test
What is the Kruskal-Wallis test?
The Kruskal-Wallis test is a nonparametric hypothesis test that compares two or more independent samples. You would use this test if the normality assumption of your one-way ANOVA test is not valid. The Kruskal-Wallis test replaces the data with their ranks, then performs the test.
Example of the Kruskal-Wallis test
Suppose you are interested in knowing if the distribution of particle counts is the same for each furnace at a deposition operation in semiconductor manufacturing. Five furnaces will be compared in the study. The number of particles is measured for 10 runs per furnace. The data are shown in the table below.
| DEP1 | DEP2 | DEP3 | DEP4 | DEP5 |
| 8 | 15 | 26 | 0 | 1 |
| 3 | 25 | 6 | 26 | 44 |
| 0 | 111 | 0 | 42 | 0 |
| 0 | 27 | 36 | 4 | 12 |
| 5 | 46 | 38 | 0 | 5 |
| 2 | 3 | 25 | 0 | 25 |
| 0 | 48 | 27 | 1 | 43 |
| 4 | 59 | 7 | 4 | 3 |
| 50 | 201 | 5 | 16 | 0 |
| 0 | 0 | 156 | 24 | 0 |
A graph of the data shows particle counts for each furnace.
A normal quantile plot of the data for each furnace shows evidence of non-normality within each group. If the data were normally distributed, we would expect to see the points fall randomly above or below the red diagonal lines. Instead, the points are above the line at the left and right, and below the line in the center (C-shaped pattern). This pattern is consistent with skewed data, which makes sense for particle counts since they have a lower limit at zero.
The Kruskal-Wallis test on the ranks shows a significant difference among the groups, with a p-value of 0.0228. The alternative hypothesis is that at least one group’s average rank is different from another group’s average rank. This hypothesis is equivalent to the hypothesis that the groups have different medians. You conclude that at least one group’s median particle count is different from another group’s median particle count.