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/.csv files
  • 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

FieldWhat it shows
H StatisticKruskal-Wallis H value (corrected for ties)
Degrees of Freedomk − 1
P-value (NEJM)Significance from chi-square distribution
Effect Size (η²)Eta-squared with interpretation label
Group MediansMedian per group
Mean RanksMean 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

ComponentFormula
Uncorrected HH = (12 / (N(N+1))) × Σᵢ (Rᵢ² / nᵢ) − 3(N+1)
Ties correctionC = 1 − (Σ (tⱼ³ − tⱼ)) / (N³ − N)
H_correctedH / 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]

η² valueLabel
< 0.06Small effect
0.06 – 0.14Medium effect
≥ 0.14Large effect

Post-hoc — Dunn's Test with Bonferroni correction

For each pair (i, j):

ComponentFormula
SE√(((N(N+1)/12) − (Σ(tⱼ³ − tⱼ)/(12(N−1)))) × (1/nᵢ + 1/nⱼ))
Z(R̄ᵢ − R̄ⱼ) / SE
Adjusted pmin(p × k(k−1)/2, 1.0)