Kruskal-Wallis test: overview

This page offers structured overviews of one or more selected methods. Add additional methods for comparisons by clicking on the dropdown button in the right-hand column. To practice with a specific method click the button at the bottom row of the table

Kruskal-Wallis test
Independent variable
One categorical with $I$ independent groups ($I \geqslant 2$)
Dependent variable
One categorical of ordinal level
Null hypothesis
Formulation 1:
  • The scores in any of the $I$ populations are not systematically higher or lower than the scores in any of the other populations
Formulation 2:
  • The probability that an observation from population $g$ exceeds an observation from population $h$ is the same as the probability that an observation from population $h$ exceeds an observation from population $g$, for each pair of groups.
Formulation 3:
  • P(observation from population $g$ > observation from population $h$) = P(observation from population $h$ > observation from population $g$), for each pair of groups.
Alternative hypothesis
Formulation 1:
  • The scores in some populations are systematically higher or lower than the scores in other populations
Formulation 2:
  • For at least one pair of groups, the probability that an observation from population $g$ exceeds an observation from population $h$ is not the same as the probability that an observation from population $h$ exceeds an observation from population $g$.
Formulation 3:
  • For at least one pair of groups:
    P(observation from population $g$ > observation from population $h$) $\neq$ P(observation from population $h$ > observation from population $g$)
Assumptions
Group 1 sample is a simple random sample (SRS) from population 1, group 2 sample is an independent SRS from population 2, $\ldots$, group $I$ sample is an independent SRS from population $I$. That is, within and between groups, observations are independent of one another
Test statistic

$H = \dfrac{12}{N (N + 1)} \sum \dfrac{R^2_i}{n_i} - 3(N + 1)$

Here $N$ is the total sample size, $R_i$ is the sum of the ranks for sample $i$, and $n_i$ is the sample size for sample $i$. Remember that multiplication precedes addition, so first compute $\frac{12}{N (N + 1)} \times \sum \frac{R^2_i}{n_i}$ and then subtract $3(N + 1)$.

Note: if ties are present in the data, the formula for $H$ is more complicated.
Sampling distribution of $H$ if H0 were true

For large samples, approximately the chi-squared distribution with $I - 1$ degrees of freedom.

For small samples, the exact distribution of $H$ should be used.

Significant?
For large samples, the table with critical $X^2$ values can be used. If we denote $X^2 = H$:
  • Check if $X^2$ observed in sample is equal to or larger than critical value $X^{2*}$ or
  • Find $p$ value corresponding to observed $X^2$ and check if it is equal to or smaller than $\alpha$
Example context
Do people from different religions tend to score different on social economic status?
Pratice questions