ARBIMETRA · Financial intelligence, made practical.

ARBIMETRA LAB

Kruskal-Wallis Test

Compares several independent groups using ranks, with Dunn post-hoc comparisons.

What it does

Compares several independent groups using ranks, with Dunn post-hoc comparisons.

Use it as a non-parametric alternative to one-way ANOVA.

Data you need

  • Outcome
  • Three or more groups

Supported data: Numeric, Categorical. Level: Intermediate.

Formula and method

H = [12/(N(N+1))] Σ R²ᵢ/nᵢ − 3(N+1), corrected for ties

All observations are ranked together and each group's mean rank is compared with the overall mean rank. The H statistic is corrected for ties and compared with a chi-square distribution. Dunn's test then compares pairs.

Assumptions

  • Observations are independent

Input checks

  • At least three groups
  • All-equal data are rejected

How to read the result

A small p-value shows that at least one group differs. Use the Dunn table to locate it.

Worked example

Illustrative run on Simulated study data (teaching data). These figures are the actual output of this model on that example, and they say nothing about your own data.

  • H = 3.9894, df = 2, p = 0.1361, epsilon squared = 0.0167.
  • The differences are not statistically significant at the 5% level.

Limitations

  • The chi-square reference is approximate in small groups

Numerical validation

Validated 16 of 16 automated checks passed, including numerical results, invalid input, missing values, small samples, constant variables, charts and the interpretation text.

CheckReferenceResultAbs. errorToleranceSource
H statistic0.771430.771428571.4e-61e-4Hollander and Wolfe example, as published in R documentation
p-value0.680.679964773.5e-51e-2Hollander and Wolfe example, as published in R documentation

Computed with python 3.13.2, numpy 2.2.5, scipy 1.14.1, pandas 2.3.3, statsmodels 0.14.4, scikit-learn 1.7.0, in your browser. A passing check confirms the listed comparison only. It does not make any result suitable for your data, and it is not a claim of equivalence with other statistical software.

Questions

What is Dunn's test?

A pairwise follow-up to Kruskal-Wallis. Here its p-values use a Bonferroni adjustment.

ARBIMETRA LAB is an educational and research tool. Results should be checked by the researcher and are not professional advice.