Non-parametric Methods · KW-KG

Sample Size for Comparing Three or More Independent Groups

Kruskal–Wallis Test

1. Information obtained from previous study / literature

Enter the common planning SD in the same outcome units as the group locations.

Help estimate planning SD from published summaries

A reported median alone cannot be converted into a standard deviation. The helper reconstructs a common within-group planning SD from a comparable study's quartiles or range under an approximately Normal working model.

2. Information decided by the researcher — anticipated locations

3. Researcher settings

4. Results

Enter planning assumptions and select Calculate.

Formula, assumptions, limitations, and methodological note

Example clinical scenario

A researcher compares postoperative length of stay across three independent analgesia protocols. Because length of stay is strongly skewed, the primary analysis uses a Kruskal–Wallis test.

Formula and methodological note

The Kruskal–Wallis test evaluates an overall difference in group rank distributions and does not generally test medians alone. A median/location interpretation is appropriate here only under the stated common-shape location-shift model. Version 1 assumes continuous outcomes with negligible ties and uses a large-sample noncentral chi-square approximation. It does not determine which groups differ or provide power for post-hoc comparisons.

For each pair, pij = P(Xj > Xi) = Φ[(θj−θi)/(√2σ)]. The calculation uses the noncentrality λ = 12Σ niEi²/[N(N+1)] and a right-tail chi-square statistic with k−1 degrees of freedom.

Equal and custom whole-number allocation ratios are enforced exactly for every candidate and final sample size. Substantial ties, unequal group shapes or dispersions, clustering, repeated measures, ordinal outcomes, pairwise-power planning, and covariate adjustment are outside scope.

These tools support research planning and do not replace statistical consultation.

Method references

  1. Kruskal WH, Wallis WA. Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association. 1952;47(260):583–621. doi:10.1080/01621459.1952.10483441.
  2. Jankowski S. MultNonParam: Multivariate Nonparametric Methods. R package version 1.3.9; 2023. CRAN.
  3. Wan X, Wang W, Liu J, Tong T. Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology. 2014;14:135. doi:10.1186/1471-2288-14-135.

Suggested citation

Yaacob, Najib Majdi. “Sample Size for Comparing Three or More Independent Groups (KW-KG).” Web calculator. NajibMY, 2026. Accessed July 29, 2026. https://najibmy.netlify.app/tools/sample-size/comparing-three-or-more-independent-groups-kruskal-wallis/.