Chi-Square Test Calculator (2 × 2)

Assess statistical independence between two categorical variables in a 2 × 2 contingency table with Pearson's χ², Yates' continuity correction, expected frequencies, and Cramér's V.

Advertisement
Sponsored Content (728x90)
Observed Frequencies (Oij)

Enter empirical integer counts for each combination:

Exposure / Group Outcome (+) Outcome (−)
Exposed / Arm 1
Unexposed / Arm 2

Expected Frequencies Matrix (Eij)

Arm 1 Expected 27.50 72.50
Arm 2 Expected 27.50 72.50
Independence Test Results
Pearson p-Value (df = 1)
< 0.0001
Pearson χ² Statistic: 15.244
Statistically Significant Association: Significant association observed. Reject null hypothesis of independence.
Yates' Corrected χ² 14.043
Yates' Corrected p-Value 0.0002
Cramér's V (Phi φ) 0.276
Total Sample Size (N) 200
χ²(1, N = 200) = 15.24, p < 0.001, Cramér's V = 0.28
Advertisement
Sponsored Content (300x250)

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:

$$E_{ij} = \frac{R_i \times C_j}{N}$$

The standard Pearson $\chi^2$ test statistic is the sum of squared standardized residuals:

$$\chi^2 = \sum_{i=1}^{r} \sum_{j=1}^{c} \frac{(O_{ij} - E_{ij})^2}{E_{ij}}$$

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:

$$\chi^2_{\text{Yates}} = \sum \frac{(|O_{ij} - E_{ij}| - 0.5)^2}{E_{ij}}$$

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 = \sqrt{\frac{\chi^2}{N}}$$

Cochran's Conditions for Validity

William G. Cochran (1954) established fundamental guidelines regarding sample size adequacy for the Chi-Square approximation:

  1. In a $2 \times 2$ table, all expected counts ($E_{ij}$) must be $\ge 5$.
  2. Observations must be mutually independent (paired or matched designs require McNemar's test instead).
  3. If any expected cell count is below $5$, Fisher's exact test is recommended.

Academic References

Advertisement
Sponsored Content (728x90)