Kruskal Wallis H Test
The Kruskal-Wallis H Test compares three or more independent groups on a continuous or ordinal outcome — the nonparametric counterpart of one-way ANOVA. Example: comparing satisfaction scores across four hospital departments.
Step 1 — Provide your groups
The Data Input panel starts with two empty groups and lets you Add Group / Remove Group. Three input methods:
- Upload from Excel — reads
.xlsx/.xls/.csvfiles - Manual Data Entry — type or paste values into each group's text area
- Generate Random Data — fills groups with different means (around 25–32, SD ≈ 5)
Step 2 — Calculate
Click Calculate Kruskal-Wallis Test.
Step 3 — Read the results
| Field | What it shows |
|---|---|
| H Statistic | Kruskal-Wallis H value (corrected for ties) |
| Degrees of Freedom | k − 1 |
| P-value (NEJM) | Significance from chi-square distribution |
| Effect Size (η²) | Eta-squared with interpretation label |
| Group Medians | Median per group |
| Mean Ranks | Mean rank per group |
Step 4 — Post-hoc analysis
Dunn's Test — if the overall test is significant (p < 0.05) and there are more than two groups, pairwise comparisons appear showing:
- Group labels
- Z-statistic
- Bonferroni-adjusted p-value
- Significance flag
Step 5 — Visualisation and discussion
A BoxPlot compares all groups side by side.
A UniversalChatBot is available for discussion.
Statistical methods used
Test statistic — H
| Component | Formula |
|---|---|
| Uncorrected H | H = (12 / (N(N+1))) × Σᵢ (Rᵢ² / nᵢ) − 3(N+1) |
| Ties correction | C = 1 − (Σ (tⱼ³ − tⱼ)) / (N³ − N) |
| H_corrected | H / C |
p-value: 1 − χ²_CDF(H, k − 1)
Hypothesis statement
- H₀: All k groups come from the same distribution
- H₁: At least one group differs
- Significance level: α = 0.05
Effect size — Eta-squared (η²)
η² = (H − df) / (N − 1), clamped to [0, 1]
| η² value | Label |
|---|---|
< 0.06 |
Small effect |
0.06 – 0.14 |
Medium effect |
≥ 0.14 |
Large effect |
Post-hoc — Dunn's Test with Bonferroni correction
For each pair (i, j):
| Component | Formula |
|---|---|
| SE | √(((N(N+1)/12) − (Σ(tⱼ³ − tⱼ)/(12(N−1)))) × (1/nᵢ + 1/nⱼ)) |
| Z | (R̄ᵢ − R̄ⱼ) / SE |
| Adjusted p | min(p × k(k−1)/2, 1.0) |