Statistical Calculators › Proportions: Many Groups › R × C Contingency Table Sample Size Calculator
← All Calculators

Proportions: Many Groups

R × C Contingency Table Sample Size Calculator

Calculate the total sample size required for a chi-square test of independence in an R × C contingency table using Cohen's chi-square effect size w, the desired power, and the significance level. The calculation uses the noncentral chi-square distribution and runs entirely in your browser.

Study Design

Enter the dimensions of the contingency table and the desired statistical operating characteristics.
4
For a test of independence, DF = (R − 1)(C − 1).
Cohen's conventional reference values are approximately 0.10 (small), 0.30 (medium), and 0.50 (large).

Required Sample Size

The reported N is the smallest integer sample size whose calculated power meets or exceeds the requested target.
Enter the design parameters and click Calculate Sample Size.

Methodology

This calculator implements the chi-square test of independence for an R × C contingency table using Cohen's effect-size parameter w. This is a sample-size and power calculation for chi-square tests of independence in contingency tables. The degrees of freedom are determined from the table dimensions: DF = (R − 1)(C − 1).

Effect Size

The chi-square effect size is defined from the difference between the cell probabilities under the alternative and null hypotheses:

w = √Σij [(p1ij − p0ij)² / p0ij]

The corresponding noncentrality parameter is λ = Nw². Thus, for a specified effect size and sample size, the chi-square statistic has a noncentral chi-square distribution with DF degrees of freedom and noncentrality parameter λ = Nw².

Sample Size Calculation

For a two-sided chi-square test at significance level α, the rejection threshold is the upper α quantile of the central chi-square distribution:

Critical value = χ²1−α, DF

Power for a candidate sample size N is then the upper-tail probability of the noncentral chi-square distribution:

Power = P(χ²DF,λ=Nw² ≥ χ²1−α,DF)

The calculator searches upward over integer values of N and returns the first value for which the calculated power is at least the requested target. This reproduces the approach used in the this method documentation, including its noncentral chi-square calculation.

Interpretation of W

Cohen proposed w values of 0.10, 0.30, and 0.50 as conventional small, medium, and large effect-size reference points, respectively. These are planning conventions rather than universal clinical thresholds; the appropriate effect size should ideally be based on scientifically meaningful alternative cell probabilities.

Validation Example

This worked example: A 3 × 3 contingency table has DF = (3 − 1)(3 − 1) = 4. Set α = 0.05 and target power = 0.80.

For W = 0.10, expected N = 1194, with calculated power 0.80018.

For W = 0.30, expected N = 133, with calculated power 0.80130.

For W = 0.50, expected N = 48, with calculated power 0.80243.

These values are reproduced by the JavaScript implementation used on this page. The same implementation also reproduces the this method validation example based on Cohen's reported case of DF = 2, N = 140, α = 0.01: W = 0.30 gives power 0.74841 and W = 0.40 gives power 0.96641.

References

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

the software, LLC. this method Sample Size Software: Chi-Square Tests. the relevant methodological literature. The procedure documentation describes the effect-size definition, the relationship χ² = Nw², contingency-table degrees of freedom, worked examples, and validation against Cohen.

the software, LLC. this method Sample Size Software. this method provides dedicated procedures for sample-size and power analysis of contingency-table chi-square tests and documents validation examples for its procedures.