Theory & Application of the Chi-Square Test
The Pearson Chi-Square test of independence (Pearson, 1900) determines whether there is a statistically significant relationship between two categorical nominal variables. In an epidemiological context, it evaluates whether the proportion of individuals developing a condition is independent of their exposure status.
Expected Frequencies Derivation
Under the null hypothesis ($H_0$) that rows and columns are completely independent, the expected frequency $E_{ij}$ for row $i$ and column $j$ is calculated as the product of the respective marginal totals divided by the grand sample size:
The standard Pearson $\chi^2$ test statistic is the sum of squared standardized residuals:
For a $2 \times 2$ contingency table, the degrees of freedom equal $(r - 1)(c - 1) = (2 - 1)(2 - 1) = 1$.
Yates' Continuity Correction
Because the continuous theoretical Chi-Square distribution is used to approximate the discrete frequencies of counts, the standard Pearson test slightly underestimates the $p$-value for smaller sample sizes. Frank Yates (1934) proposed subtracting $0.5$ from each absolute deviation:
Yates' correction yields a more conservative test that helps control Type I error inflation when sample sizes are modest.
Effect Size: Cramér's V
In a $2 \times 2$ table, Cramér's $V$ is identical to the Pearson correlation coefficient $\phi$ (Phi) for binary variables:
- $V \approx 0.10$: Weak association.
- $V \approx 0.30$: Moderate association.
- $V \ge 0.50$: Strong association.
Cochran's Conditions for Validity
William G. Cochran (1954) established fundamental guidelines regarding sample size adequacy for the Chi-Square approximation:
- In a $2 \times 2$ table, all expected counts ($E_{ij}$) must be $\ge 5$.
- Observations must be mutually independent (paired or matched designs require McNemar's test instead).
- If any expected cell count is below $5$, Fisher's exact test is recommended.
Academic References
- Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. Philosophical Magazine, 50(302), 157–175.
- Yates, F. (1934). Contingency tables involving small numbers and the $\chi^2$ test. Supplement to the Journal of the Royal Statistical Society, 1(2), 217–235.
- Cochran, W. G. (1954). Some methods for strengthening the common $\chi^2$ tests. Biometrics, 10(4), 417–451.
- Agresti, A. (2013). Categorical Data Analysis (3rd ed.). John Wiley & Sons.