The Kruskal-Wallis test is a non-parametric statistical test that is used to determine if there are statistically significant differences between the medians of three or more independent groups. It is an extension of the Mann-Whitney U test and is particularly useful when the assumptions of one-way ANOVA (such as normality) cannot be met.
28.0.1 Assumptions
The Kruskal-Wallis test relies on the following assumptions:
Independence of Samples: The groups are independent of one another.
Ordinal or Continuous Data: The data within and across groups should be ordinal or continuous.
Similarity of Shape: The distributions of the groups should be similar, allowing the medians to be comparable.
28.0.2 Hypotheses
The hypotheses for the Kruskal-Wallis test are as follows:
Null Hypothesis (H₀): The medians of all groups are equal.
Alternative Hypothesis (H₁): At least one group’s median is different from the others.
28.0.3 Formula
The test statistic (H) is calculated as follows: \[
H = \left(\frac{12}{n(n+1)}\right) \sum_{i=1}^k \frac{R_i^2}{n_i} - 3(n+1)
\] Where:
\(n\) is the total number of observations.
\(k\) is the number of groups.
\(R_i\) is the sum of ranks in the \(i^{th}\) group.
\(n_i\) is the number of observations in the \(i^{th}\) group.
28.0.4 Calculation Steps
Rank all data from all groups together; the lowest value gets rank 1, the next lowest rank 2, and so on.
Calculate the sum of ranks for each group.
Use the formula to calculate the H statistic.
28.0.5 Interpretation
A large value of H indicates a rejection of the null hypothesis. This value is compared against a chi-square distribution with \(k-1\) degrees of freedom. If the calculated H is greater than the critical value from the chi-square table at the desired level of significance, the null hypothesis is rejected.
28.0.6 Example Problem
Let’s consider an example where a researcher wants to compare the effectiveness of four different medications. The response scores from patients are as follows:
Medication A: 67, 75, 74, 70
Medication B: 70, 65, 76, 68
Medication C: 82, 85, 87, 83
Medication D: 60, 59, 61, 65
Hypotheses:
Null Hypothesis (H₀): The median response scores for all four medications are the same.
Alternative Hypothesis (H₁): At least one medication’s median response score is different from the others.
This method allows for a robust analysis of variance when the data is not suited to traditional ANOVA, providing valuable insights in fields such as medicine, psychology, and ecological research.