Chi-Square Power Analysis

Statistics
Introduced by
Jacob Cohen
Year
1988
Type
Sample size and power calculation

What does it do?

Chi-square power analysis is a prospective calculation that gives either the sample size needed, or the power achieved by a given sample, for chi-square tests of independence or goodness of fit.

It is built on Cohen's w effect size, set out by Jacob Cohen in his book on statistical power for the behavioral sciences. The inputs are an anticipated w, the significance level, the target power, and the degrees of freedom set by the table dimensions or the number of categories.

The intuition behind the method

Before collecting categorical data, a researcher needs to know how many cases are required to detect a real association or a departure from an expected distribution. The analysis takes an anticipated effect size expressed as Cohen's w, a significance level, a target power, and the degrees of freedom, and solves for the sample size n. Run in reverse, with the sample actually obtained, it gives the power the study had. This reverse use matters most after a non-significant result, because it shows whether the design could have detected the effect that was assumed.

History

Jacob Cohen set out the power framework and the w index in Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Cohen's w is the chi-square counterpart of his other effect size measures, and the book tabulates sample sizes for combinations of w, α, df and power.

When to use it

Choose this analysis when a study will compare categorical outcomes across groups (a test of independence in a contingency table) or test whether observed category frequencies match a theoretical distribution (goodness of fit), and when you can specify an expected effect size in Cohen's w. The number of categories or table cells sets the degrees of freedom. Do not rely on it when many expected cell counts fall below 5, because the chi-square approximation then fails; use Fisher's exact test or a simulation-based power calculation instead. It is also not the right tool for continuous outcomes, where t-test, ANOVA or correlation power analysis is more appropriate. If no defensible w can be justified from prior work or pilot data, the calculation mostly restates the assumption chosen.

Limitations and considerations

  • The result is only as good as the anticipated w; without pilot data or prior studies reporting a comparable association, the value is largely an assumption.
  • The non-central chi-square approximation is less accurate for sparse tables with small expected cell counts.
  • The 0.80 target power is a convention; the appropriate level depends on the relative costs of Type I and Type II errors in the study.
  • It does not adjust for planned subgroup analyses or multiple comparisons, which increase the required n.
  • The calculation and the test both rely on large-sample chi-square approximations. The absence of a normality requirement does not remove the need for adequate expected cell counts.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Gives a pre-study sample size tied to an explicit effect size, so the assumed w, α, target power and df can be stated in the design rationale.
  • Cohen's w has conventional benchmarks (0.10 small, 0.30 medium, 0.50 large) that provide a starting point when no pilot estimate exists.
  • The same framework covers independence and goodness-of-fit tests; only the degrees of freedom change with table shape or number of categories.
  • It makes no normality assumption, which suits purely categorical outcomes. The reference distributions are defined differently in each case: for goodness of fit, P0 is the expected distribution and P1 the alternative distribution, while for independence the null cell proportions are built from the row and column marginals and P1 is the anticipated cell distribution.

Applications

  • Survey planning: estimating how many respondents are needed to detect a medium association between a demographic variable and a binary outcome.
  • Clinical trial planning: checking whether a planned sample can detect a difference in response classification between two patient groups.
  • Education research: sizing a study that tests whether course format (online or in person) is associated with pass or fail status.
  • Retrospective assessment of a non-significant chi-square result, using a theoretically justified w, to judge whether the design could have detected the assumed association.
  • Goodness-of-fit planning: determining whether a planned sample can detect departures of category frequencies from an expected distribution.

How it works

How it works

1

The null hypothesis asserts no association between the categorical variables (or that the observed distribution matches the expected one for goodness-of-fit). The alternative asserts that an association exists or that the distribution deviates. Power analysis asks: if H₁ is true with a specified effect size w, how likely is the test to reject H₀?

Formula
H_0:\ \text{no association (or uniform fit)} \quad H_1:\ \text{association exists (or fit deviates)}
2

Cohen's w is the square root of the sum, over categories, of the squared difference between the alternative and null cell proportions, each divided by the null proportion. It measures how far the anticipated distribution lies from the one specified under H₀, independently of sample size. The noncentrality parameter λ needed to reach the target power at the chosen significance level and df = (rows − 1)(columns − 1) (or k − 1 for goodness of fit) has no closed form and is found numerically from the noncentral chi-square distribution. The required sample size then follows as n = λ / w².

Formula
w = \sqrt{\sum_{i=1}^{k} \frac{(P_{1i} - P_{0i})^2}{P_{0i}}} \;; \quad n = \frac{\chi^2_{\alpha,\,df,\,1-\beta}}{w^2}
3

Power is the probability that the chi-square statistic exceeds the critical value when the non-centrality parameter equals n·w². For α = 0.05 and a target power of 0.80, the calculation returns the smallest n that meets the target. If that n is not feasible, the analyst can lower the target power or reconsider whether the anticipated w is realistic. The approximation becomes unreliable when expected cell counts are small; in that case, exact tests or simulation-based power estimates are preferable.

Formula
\text{Achieved power: } 1-\beta = P\!\left(\chi^2(df,\,\lambda) > \chi^2_{\alpha,\,df}\right), \quad \lambda = n\,w^2

Common pitfalls

  • Choosing an optimistic w to justify a small sample. Base w on prior estimates or on a conservative value justified within the field.
  • Treating the computed n as a recruitment target. It counts analysable cases, so recruitment should be raised to allow for the dropout or non-response expected in the specific design.
  • Reporting only the resulting n. Report the assumed w, α, target power and df so readers can reproduce the calculation.
  • Using the wrong degrees of freedom. A 2×2 table has df = 1, while an r × c table has (r − 1)(c − 1); df must match the test actually planned.
  • Using observed power computed from the study's own test statistic as evidence. Post-hoc power should use a theoretically meaningful w.

Frequently asked questions

What is Cohen's w and how do I choose a value?

Cohen's w measures the overall discrepancy between observed and expected cell proportions in a chi-square framework. Cohen's conventional benchmarks are w = 0.10 (small), w = 0.30 (medium), and w = 0.50 (large). Where possible, derive w from pilot data or from prior studies reporting a comparable association, and convert from published Cramér's V values where the table dimensions are known. Using a benchmark value without a basis in comparable data can oversize or undersize a study if the true effect differs substantially.

How do I set the degrees of freedom?

For a chi-square independence test on an r × c contingency table, df = (r − 1)(c − 1). For a goodness-of-fit test with k categories, df = k − 1. The degrees of freedom directly affect the critical chi-square value and therefore the required sample size; a larger table with more df generally requires a larger n to achieve the same power.

Can I use this analysis after the study is finished?

Yes. Post-hoc (retrospective) power analysis uses the realized n and a theoretically meaningful w to estimate the power the study had. That w should come from prior literature or from a pre-specified minimal effect size of interest, not from the effect observed in the study. This is informative when reporting a non-significant result: if post-hoc power is below 0.80, the study may have been underpowered rather than reflecting a true null effect. Computing power from the observed test statistic (observed power) is circular and not recommended, because it is determined by the p-value already obtained.

When should I switch to Fisher's exact test power instead?

When many expected cell counts fall below 5, the chi-square approximation becomes unreliable, and Fisher's exact test is preferred for the analysis itself. Power for Fisher's exact test is generally estimated by simulation, because the chi-square non-central formula does not apply.

Related methods

Sources

  1. Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.

    ISBN: 978-0805802832