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
Chi-squared test for the relationship between two categorical variables
One categorical with $I$ independent groups ($I \geqslant 2$)
One categorical with $I$ independent groups ($I \geqslant 2$)
Dependent variable
Dependent /row variable
One of ordinal level
One categorical with $J$ independent groups ($J \geqslant 2$)
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:
H_{0}: the population medians for the $I$ groups are equal
Else:
Formulation 1:
H_{0}: the population scores in any of the $I$ groups are not systematically higher or lower than the population scores in any of the other groups
Formulation 2:
H_{0}:
P(an observation from population $g$ exceeds an observation from population $h$) = P(an observation from population $h$ exceeds an observation from population $g$), for each pair of groups.
Several different formulations of the null hypothesis can be found in the literature, and we do not agree with all of them. Make sure you (also) learn the one that is given in your text book or by your teacher.
H_{0}: there is no association between the row and column variable
More precisely, if there are $I$ independent random samples of size $n_i$ from each of $I$ populations, defined by the independent variable:
H_{0}: the distribution of the dependent variable is the same in each of the $I$ populations
If there is one random sample of size $N$ from the total population:
H_{0}: the row and column variables are independent
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:
H_{1}: not all of the population medians for the $I$ groups are equal
Else:
Formulation 1:
H_{1}:
the poplation scores in some groups are systematically higher or lower than the population scores in other groups
Formulation 2:
H_{1}:
for at least one pair of groups:
P(an observation from population $g$ exceeds an observation from population $h$) $\neq$ P(an observation from population $h$ exceeds an observation from population $g$)
H_{1}: there is an association between the row and column variable
More precisely, if there are $I$ independent random samples of size $n_i$ from each of $I$ populations, defined by the independent variable:
H_{1}: the distribution of the dependent variable is not the same in all of the $I$ populations
If there is one random sample of size $N$ from the total population:
H_{1}: the row and column variables are dependent
Assumptions
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
Sample size is large enough for $X^2$ to be approximately chi-squared distributed under the null hypothesis. Rule of thumb:
2 $\times$ 2 table: all four expected cell counts are 5 or more
Larger than 2 $\times$ 2 tables: average of the expected cell counts is 5 or more, smallest expected cell count is 1 or more
There are $I$ independent simple random samples from each of $I$ populations defined by the independent variable, or there is one simple random sample from the total population
Here $N$ is the total sample size, $R_i$ is the sum of ranks in group $i$, and $n_i$ is the sample size of group $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.
$X^2 = \sum{\frac{(\mbox{observed cell count} - \mbox{expected cell count})^2}{\mbox{expected cell count}}}$
Here for each cell, the expected cell count = $\dfrac{\mbox{row total} \times \mbox{column total}}{\mbox{total sample size}}$, the observed cell count is the observed sample count in that same cell, and the sum is over all $I \times J$ cells.
Put your dependent variable in the box below Test Variable List and your independent (grouping) variable in the box below Grouping Variable
Click on the Define Range... button. If you can't click on it, first click on the grouping variable so its background turns yellow
Fill in the smallest value you have used to indicate your groups in the box next to Minimum, and the largest value you have used to indicate your groups in the box next to Maximum
Continue and click OK
Analyze > Descriptive Statistics > Crosstabs...
Put one of your two categorical variables in the box below Row(s), and the other categorical variable in the box below Column(s)
Click the Statistics... button, and click on the square in front of Chi-square
Continue and click OK
Jamovi
Jamovi
ANOVA > One Way ANOVA - Kruskal-Wallis
Put your dependent variable in the box below Dependent Variables and your independent (grouping) variable in the box below Grouping Variable
Frequencies > Independent Samples - $\chi^2$ test of association
Put one of your two categorical variables in the box below Rows, and the other categorical variable in the box below Columns