The Kruskal-Wallis Test Calculator helps you perform non-parametric analysis of variance to compare three or more independent groups. It determines whether samples originate from the same distribution by analyzing the ranks of the data rather than the raw values. This makes it particularly useful when your data violates the assumptions of one-way ANOVA, such as normality or equal variances. Common applications include comparing patient outcomes across multiple treatment groups, analyzing survey responses, or evaluating differences in performance metrics across departments. Click here to populate the sample data for a quick example.
Calculator
1. Load Your Data
2. Select Columns & Options
Learn More
Kruskal-Wallis Test
Definition
Kruskal-Wallis Test is a non-parametric method for testing whether samples originate from the same distribution. It's used to determine if there are statistically significant differences between two or more groups of an independent variable on a continuous or ordinal dependent variable. It extends the Mann–Whitney U test, which is used for comparing only two groups. The parametric equivalent of the Kruskal–Wallis test is the one-way analysis of variance(ANOVA).
A significant result indicates that at least one group differs from the others, but it doesn't identify which group is different. Post-hoc tests such as Dunn's test or pairwise Mann-Whitney U test with Bonferroni correction are often used to determine which groups are significantly different.
Test Statistic
Where:
- = total number of observations
- = number of observations in group
- = sum of ranks for group
- = number of groups
Tie Correction
where is the number of tied observations at rank .
The corrected test statistic is then calculated as:
Key Assumptions
Practical Example
Step 1: State the Data
Test scores from three groups:
- Group 1:
- Group 2:
- Group 3:
Step 2: State Hypotheses
- : The distributions are the same across groups
- : At least one group differs in distribution
Step 3: Calculate Ranks
Value | Rank | Rank (Adjusted for ties) | Group |
---|---|---|---|
5 | 1 | 1 | Group 1 |
6 | 2 | 2.5 | Group 1 |
6 | 3 | 2.5 | Group 2 |
7 | 4 | 4 | Group 1 |
8 | 5 | 6 | Group 1 |
8 | 6 | 6 | Group 2 |
8 | 7 | 6 | Group 3 |
9 | 8 | 8.5 | Group 2 |
9 | 9 | 8.5 | Group 3 |
10 | 10 | 10.5 | Group 2 |
10 | 11 | 10.5 | Group 3 |
Step 4: Calculate Rank Sums
- Group 1:
- Group 2:
- Group 3:
- Total number of observations:
Step 5: Calculate H Statistic
Here, tied ranks are:- (the tie occurs at rank 2)
Step 6: Draw Conclusion
Referring to the Chi-square distribution table, the critical value for with degrees of freedom at a significance level of is .
The p-value can be found using the Chi-square Distribution Calculator with and , which gives .
Since (critical value), we fail to reject . There is insufficient evidence to conclude that the distributions differ significantly across groups.
Effect Size
Eta-squared () measures the proportion of variability in ranks explained by groups:
Where:
- = Kruskal-Wallis statistic
- = number of groups
- = total sample size
Interpretation guidelines:
For our example:
This indicates a large effect size, suggesting substantial practical significance in the differences between groups, even though the result was not statistically significant.