Means: Many Groups (ANOVA)
Estimate the sample size required for a Kruskal-Wallis test comparing multiple independent groups. This calculator uses Monte Carlo simulation of the Kruskal-Wallis rank statistic under the null and alternative distributions, following the simulation approach used by PASS. Runs entirely in your browser.
The Kruskal-Wallis test is the rank-based, non-parametric analogue of the one-way analysis of variance for comparing multiple independent groups. For sample-size planning, PASS provides a dedicated Kruskal-Wallis Tests (Simulation) procedure rather than relying on a single closed-form normal-theory sample-size formula.
This calculator follows that simulation framework. For each candidate sample size, it generates independent observations from the user-specified alternative distributions, ranks all observations together, calculates the Kruskal-Wallis statistic, and records the proportion of simulations that reject the null hypothesis.
Under the null hypothesis, all groups are generated from the same distribution. The null simulations establish the empirical rejection threshold at the requested alpha level. The alternative simulations use the group-specific distributions entered by the user. Estimated power is the proportion of alternative simulations whose Kruskal-Wallis statistic exceeds that null threshold.
Candidate equal group sizes are evaluated sequentially from the specified minimum through the specified maximum. The calculator returns the first group size whose simulated power is at least the requested target power.
Because this is a simulation-based procedure, estimated power has Monte Carlo variability. Increasing the number of simulations makes the estimate more stable. PASS's published examples use 5,000 simulations per run, which is also the default here.
The test itself is non-parametric, but sample-size planning still requires an assumed data-generating distribution under the alternative hypothesis. The normal distributions used by the worked validation example below are therefore simulation assumptions, not an assumption that the eventual Kruskal-Wallis analysis must use a normal-theory test.
The calculator was checked against the published PASS example using four equal-sized groups with means 9.775, 12, 12, and 14.225, a common standard deviation of 3, alpha = 0.05, and target power = 0.80. PASS reports that a sample size of 12 per group gives approximately 0.801 power.
The exact simulated power will vary somewhat with the random seed and number of Monte Carlo repetitions. The validation target is therefore the sample-size decision, with the published PASS example identifying 12 subjects per group as the required equal allocation for 80% power.
NCSS, LLC. (2026). Kruskal-Wallis Tests (Simulation). PASS Sample Size Software Documentation, Chapter 556. The PASS documentation describes the simulation procedure, its inputs, output, worked examples, and validation examples.
Fan, C., Zhang, D., & others (2010). “On sample size of the Kruskal-Wallis test with application to a mouse peritoneal cavity study.” Statistics in Medicine. 29(23), 2464–2473. This paper discusses alternative power and sample-size approaches for the Kruskal-Wallis test and emphasizes that power depends on the underlying distributions rather than solely on the number of groups.
Official PASS documentation: Kruskal-Wallis Tests (Simulation)