Statistical Calculators › Proportions: Many Groups › Chi-Square Goodness-of-Fit Test Sample Size Calculator
← All Calculators

Proportions: Many Groups

Chi-Square Goodness-of-Fit Test Sample Size Calculator

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.

Study Design Parameters

Specify the effect size, number of categories, alpha, and target power.
Cohen's w measures the departure of the anticipated category proportions from the hypothesized proportions. Common reference values are 0.10 (small), 0.30 (medium), and 0.50 (large).

Required Sample Size

The result is the smallest integer N whose computed power is at least the requested target.
Enter the study parameters and click Calculate Sample Size.

Methodology

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.

Cohen's Effect Size

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:

w = √∑i=1k [(p1i − p0i)2 / p0i]

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.

Noncentral Chi-Square Power Calculation

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.

λ = Nw2
df = k − 1
Power = P(χ2df,λ > χ21−α,df)

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.

Important Degrees-of-Freedom Assumption

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.

Validation Example

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.

Validation inputs: df = 2  ·  w = 0.20  ·  α = 0.10  ·  target power = 0.80
Expected: N = 193  ·  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.

References

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.