Kruskal-Wallis test - overview
This page offers structured overviews of one or more selected methods. Add additional methods for comparisons (max. of 3) 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 | Binomial test for a single proportion | McNemar's test |
You cannot compare more than 3 methods |
---|---|---|---|
Independent/grouping variable | Independent variable | Independent variable | |
One categorical with $I$ independent groups ($I \geqslant 2$) | None | 2 paired groups | |
Dependent variable | Dependent variable | Dependent variable | |
One of ordinal level | One categorical with 2 independent groups | One categorical with 2 independent groups | |
Null hypothesis | Null hypothesis | Null hypothesis | |
If the dependent variable is measured on a continuous scale and the shape of the distribution of the dependent variable is the same in all $I$ populations:
Formulation 1:
| H0: $\pi = \pi_0$
Here $\pi$ is the population proportion of 'successes', and $\pi_0$ is the population proportion of successes according to the null hypothesis. | Let's say that the scores on the dependent variable are scored 0 and 1. Then for each pair of scores, the data allow four options:
Other formulations of the null hypothesis are:
| |
Alternative hypothesis | Alternative hypothesis | Alternative hypothesis | |
If the dependent variable is measured on a continuous scale and the shape of the distribution of the dependent variable is the same in all $I$ populations:
Formulation 1:
| H1 two sided: $\pi \neq \pi_0$ H1 right sided: $\pi > \pi_0$ H1 left sided: $\pi < \pi_0$ | The alternative hypothesis H1 is that for each pair of scores, P(first score of pair is 0 while second score of pair is 1) $\neq$ P(first score of pair is 1 while second score of pair is 0). That is, the probability that a pair of scores switches from 0 to 1 is not the same as the probability that a pair of scores switches from 1 to 0. Other formulations of the alternative hypothesis are:
| |
Assumptions | Assumptions | Assumptions | |
|
|
| |
Test statistic | Test statistic | Test statistic | |
$H = \dfrac{12}{N (N + 1)} \sum \dfrac{R^2_i}{n_i} - 3(N + 1)$ | $X$ = number of successes in the sample | $X^2 = \dfrac{(b - c)^2}{b + c}$
Here $b$ is the number of pairs in the sample for which the first score is 0 while the second score is 1, and $c$ is the number of pairs in the sample for which the first score is 1 while the second score is 0. | |
Sampling distribution of $H$ if H0 were true | Sampling distribution of $X$ if H0 were true | Sampling distribution of $X^2$ 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. | Binomial($n$, $P$) distribution.
Here $n = N$ (total sample size), and $P = \pi_0$ (population proportion according to the null hypothesis). | If $b + c$ is large enough (say, > 20), approximately the chi-squared distribution with 1 degree of freedom. If $b + c$ is small, the Binomial($n$, $P$) distribution should be used, with $n = b + c$ and $P = 0.5$. In that case the test statistic becomes equal to $b$. | |
Significant? | Significant? | Significant? | |
For large samples, the table with critical $X^2$ values can be used. If we denote $X^2 = H$:
| Two sided:
| For test statistic $X^2$:
| |
n.a. | n.a. | Equivalent to | |
- | - |
| |
Example context | Example context | Example context | |
Do people from different religions tend to score differently on social economic status? | Is the proportion of smokers amongst office workers different from $\pi_0 = 0.2$? | Does a tv documentary about spiders change whether people are afraid (yes/no) of spiders? | |
SPSS | SPSS | SPSS | |
Analyze > Nonparametric Tests > Legacy Dialogs > K Independent Samples...
| Analyze > Nonparametric Tests > Legacy Dialogs > Binomial...
| Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples...
| |
Jamovi | Jamovi | Jamovi | |
ANOVA > One Way ANOVA - Kruskal-Wallis
| Frequencies > 2 Outcomes - Binomial test
| Frequencies > Paired Samples - McNemar test
| |
Practice questions | Practice questions | Practice questions | |