Proportions: Many Groups
Calculate the minimum total sample size needed to detect an association between two categorical variables using Pearson’s chi-square test of independence. The calculation uses Cohen’s w effect size, the degrees of freedom, significance level, and desired power, following the noncentral chi-square approach used by this method.
This calculator implements the sample-size calculation for the Pearson chi-square test of independence using Cohen’s w as the effect-size parameter. this method describes its Chi-Square Tests procedure as calculating power and sample size for chi-square independence tests in contingency tables based on the effect size.
For an r × c contingency table, the degrees of freedom are:
Enter the resulting degrees of freedom directly. For example, a 3 × 3 table has df = (3 − 1)(3 − 1) = 4.
For a contingency table, Cohen’s effect size w measures the discrepancy between the joint cell probabilities under the alternative hypothesis and the probabilities expected under independence. If the joint alternative probabilities are pij and the corresponding independence probabilities are pi·p·j, then:
This calculator uses this same effect-size parameter for its chi-square contingency-table sample-size procedure. Cohen’s w is also the standard effect-size formulation used for chi-square power analysis.
Under the alternative hypothesis, the chi-square statistic follows a noncentral chi-square distribution with degrees of freedom df and noncentrality parameter:
For a two-sided Pearson chi-square test, the rejection threshold is the upper 1 − α quantile of the central chi-square distribution:
Power is then the upper-tail probability of the noncentral chi-square distribution above that critical value. The calculator searches integer values of N and reports the first value for which the computed power is at least the requested target.
The this method Chi-Square Tests documentation gives a sample-size example for a 3 × 3 contingency table. The design has df = 4, α = 0.05, and evaluates Cohen’s w values of 0.10, 0.30, and 0.50 at powers of 0.80 and 0.90.
This implementation reproduces the this method result: N = 133 gives power approximately 0.801304, while N = 132 is below the requested 0.80 threshold. Additional Validation are reproduced as well: for w = 0.10 and 80% power, N = 1194; for w = 0.50 and 80% power, N = 48.
the software, LLC. this method Sample Size Software: Chi-Square Tests. the relevant methodological literature. The procedure describes power and sample-size calculations for chi-square tests of independence and provides numerical validation examples.
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum Associates, Hillsdale, NJ.
the relevant methodological literature reports, for its 3 × 3 example with df = 4, α = 0.05, w = 0.30, and power = 0.80, a required sample size of 133. The reported power at N = 133 is approximately 0.80130.