about statistical-calculators.site
Enter numerical data for each group, separated by commas, spaces, or new lines. The calculator also provides descriptive statistics and performs a Shapiro-Wilk test for normality on each group.
Follow these simple steps to perform a Kruskal-Wallis test on your data:
For each group, enter numerical data in the text area provided. You can separate values using commas, spaces, or new lines. For example:
12, 15, 18, 14 or 12 15 18 14
Give each group a meaningful name (e.g., "Treatment A", "Control Group") to make your results easier to interpret.
Click the "Add Another Group" button if you need to compare more than three groups. The calculator supports any number of groups.
Click the "Calculate" button to run the analysis. The calculator will display:
Look at the p-value in the Kruskal-Wallis test results:
Click "Export to PDF" to save a complete report including all statistics, test results, and visualizations.
The Kruskal-Wallis H test is a non-parametric (distribution-free) test 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 is considered the non-parametric alternative to the one-way ANOVA and is an extension of the Mann-Whitney U test to allow the comparison of more than two independent groups.
You should use the Kruskal-Wallis test in the following situations:
The Kruskal-Wallis test has a few key assumptions:
The test statistic, H, is calculated using the following formula:
$$ H = \left[ \frac{12}{N(N+1)} \sum_{i=1}^{k} \frac{R_i^2}{n_i} \right] - 3(N+1) $$Where:
If there are tied ranks in the data, a correction factor is applied to the H value.
An educator wants to compare the effectiveness of three different teaching methods on student exam scores. The scores for students in each method are recorded.
Null Hypothesis (\(H_0\)): The median exam scores are the same for all three teaching methods.
Alternative Hypothesis (\(H_1\)): At least one teaching method has a different median exam score.
Combine all data points and assign a rank to each one from lowest to highest.
| Score | Group | Rank |
|---|---|---|
| 72 | C | 1 |
| 74 | C | 2 |
| 75 | A | 3 |
| 78 | A | 4 |
| 79 | C | 5 |
| 81 | C | 6 |
| 82 | A | 7 |
| 85 | A | 8 |
| 86 | B | 9 |
| 88 | B | 10 |
| 90 | B | 11 |
| 92 | B | 12 |
| 94 | B | 13 |
Sum the ranks for each teaching method.
Here, \(n_1=4\), \(n_2=5\), \(n_3=4\), and the total N = 13.
The degrees of freedom (df) = k - 1 = 3 - 1 = 2. We compare our H value (9.1) to a chi-square distribution with 2 df. The critical value for α = 0.05 is 5.99. Since 9.1 > 5.99, we reject the null hypothesis. The calculated p-value for H=9.1 is approximately 0.0106.
Conclusion: There is a statistically significant difference in exam scores among the three teaching methods.
A farmer tests three different fertilizers to see if they have a different effect on crop yield (in bushels per acre). The yields are not normally distributed.
The correction factor (C) is: \( C = 1 - \frac{\sum(t^3 - t)}{N^3 - N} \), where 't' is the number of tied observations in a group of ties. We have one tie group of 2 values (t=2).
$$ C = 1 - \frac{(2^3 - 2)}{13^3 - 13} \approx 0.99725 $$The corrected H is \(H_{corrected} = H / C \):
$$ H_{corrected} = \frac{8.64}{0.99725} \approx 8.66 $$With df=2, H=8.66 is still greater than the critical value of 5.99. The p-value is approximately 0.0132. We reject the null hypothesis and conclude there is a significant difference in crop yield among the fertilizers.
R's built-in kruskal.test() function handles ties automatically and matches this calculator's corrected H-statistic:
methodA <- c(78, 82, 85, 75)
methodB <- c(88, 92, 90, 86, 94)
methodC <- c(72, 79, 81, 74)
kruskal.test(list(methodA, methodB, methodC))
# For the normality check (Shapiro-Wilk) on each group:
shapiro.test(methodA)
shapiro.test(methodB)
shapiro.test(methodC)
Analyze → Nonparametric Tests → Legacy Dialogs → K Independent Samples. Move your dependent (continuous) variable into the Test Variable List, and your grouping variable into the Grouping Variable box, then define the range of group codes. Make sure Kruskal-Wallis H is checked under Test Type. For the normality check, use Analyze → Descriptive Statistics → Explore, and request the Shapiro-Wilk test under Plots.
ANOVA → Kruskal-Wallis. Drag your dependent variable into the Dependent Variable box and your grouping variable into Fixed Factors. JASP outputs the H-statistic, df, and p-value directly, with an option to enable pairwise comparisons (Dunn's test) for post-hoc analysis. Normality per group can be checked under ANOVA → One-Way ANOVA → Assumption Checks → Normality, using Shapiro-Wilk.