Proportions: Many Groups
Calculate the total sample size required for a chi-square goodness-of-fit test using Cohen's w, the number of categories, the significance level, and the desired statistical power. The calculation uses the noncentral chi-square distribution and searches for the smallest integer sample size that achieves the requested power.
This calculator implements the standard power calculation for a one-way chi-square goodness-of-fit (multinomial) test. The test compares observed category proportions with a specified set of hypothesized proportions. For a test with k categories and no estimated distribution parameters, the degrees of freedom are df = k − 1.
The effect is represented by Cohen's w. If p0i denotes the hypothesized probability for category i and p1i denotes the probability under the alternative distribution, then:
Thus, w summarizes how far the anticipated distribution is from the null distribution. If you know the hypothesized and anticipated category probabilities, calculate w from the equation above before entering it here.
Under the alternative hypothesis, the chi-square statistic follows a noncentral chi-square distribution with noncentrality parameter λ = Nw2. The critical value is the (1 − α) quantile of a central chi-square distribution with df = k − 1 degrees of freedom.
The calculator evaluates this noncentral distribution numerically for successive integer values of N and returns the first sample size that reaches or exceeds the requested power. This avoids using a continuous approximation followed by an unchecked rounding step.
The default degrees of freedom are k − 1, appropriate when the hypothesized category probabilities are fully specified in advance. If parameters of the theoretical distribution are estimated from the same data, the degrees of freedom must be reduced for those estimated parameters. this method specifically notes this adjustment in its multinomial goodness-of-fit documentation.
this method provides a worked sample-size example for a goodness-of-fit test with df = 2, power = 0.80, α = 0.10, and Cohen's w = 0.20. Its reported result is N = 193, with calculated power 0.80046.
The implementation reproduces this result: at N = 192, power is approximately 0.79852, while at N = 193, power is approximately 0.80046. Therefore 193 is the smallest integer sample size meeting the 80% target.
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum Associates. Chapter 7, chi-square tests for goodness of fit and contingency tables.
the software, LLC. this method Sample Size Software: Chi-Square Tests. the relevant methodological literature, including the goodness-of-fit sample-size example and technical description of chi-square power calculations.
the software, LLC. Chi-Square Effect Size Estimator. this method Sample Size Software documentation. The multinomial test section describes calculation of the chi-square effect size from observed/data probabilities and hypothesized proportions.
NIST/SEMATECH. e-Handbook of Statistical Methods: Chi-Square Goodness-of-Fit Test. National Institute of Standards and Technology.