Why Correct a Chi-Square Statistic?
A chi-square test compares observed counts with counts expected under a null hypothesis. In a 2×2 table, each observed count is an integer, while an expected count can be fractional. The Pearson chi-square calculation treats the difference between those counts as if it were measured on a continuous scale. Yates continuity correction adjusts for that mismatch by reducing each absolute observed-minus-expected difference by 0.5 before squaring it.
The correction is used for a Pearson chi-square test with one degree of freedom, as in a 2×2 test of independence or homogeneity. Its effect is conservative: it cannot make the test statistic larger than the uncorrected Pearson statistic, so it cannot make the corresponding right-tail p-value smaller. The correction is a modification of the calculation, not a remedy for inadequate expected counts or other unmet conditions.
For both versions of the test, the reference distribution for a 2×2 table has \(df=1\). The p-value is the right-tail probability \(P(\chi^2_1 \ge X^2)\), using the chosen statistic. The Yates adjustment is therefore applied to the statistic first; its p-value is then found from the same chi-square distribution with one degree of freedom.
How the Half-Count Adjustment Arises
The correction can be understood by considering the boundary between integer-valued counts. Suppose an observed count \(O\) is greater than its expected count \(E\). The event of obtaining a count at least as large as \(O\) begins halfway between \(O-1\) and \(O\), at \(O-0.5\). The distance from expectation to this boundary is \(O-0.5-E=|O-E|-0.5\). If \(O<E\), the corresponding boundary for counts at least as far below expectation is \(O+0.5\), giving distance \(E-(O+0.5)=|O-E|-0.5\). If this adjusted distance would be negative, it is set to zero.
This half-count adjustment is made to each cell's absolute difference before the squared difference is divided by its expected count. It does not change the expected counts, the table margins, or the degrees of freedom.
In a 2×2 table with fixed margins, the four signed differences \(O-E\) have the same absolute value. This follows because the row and column totals determine all four expected counts: if the upper-left cell is \(d\) counts above expectation, the other three cells must differ by \(-d\), \(-d\), and \(d\), respectively, so that the row and column totals remain fixed. The correction still needs to be calculated cell by cell, because the expected counts in the denominators may differ.
Worked Examples
Worked Example: Comparing Corrected and Uncorrected Results
Suppose a hypothetical study records whether 20 participants in each of two groups experienced a particular outcome. The observations are:
| Group | Outcome: Yes | Outcome: No | Total |
|---|---|---|---|
| Group A | 14 | 6 | 20 |
| Group B | 8 | 12 | 20 |
| Total | 22 | 18 | 40 |
We test whether group and outcome are independent. Under \(H_0\), the expected count for a cell is its row total multiplied by its column total, divided by the grand total. The expected counts are 11 for each Yes cell and 9 for each No cell. All are at least 5. Assume the observations are independent and the groups and outcome categories are mutually exclusive and exhaustive; with these conditions and adequate expected counts, the chi-square approximation is appropriate.
The absolute observed-minus-expected difference is 3 in every cell. The uncorrected statistic is
For the corrected statistic, each absolute difference of 3 becomes \(3-0.5=2.5\):
Both tests have \(df=1\). Their right-tail p-values are approximately 0.0565 for Pearson and 0.112 for Yates. At \(\alpha=0.05\), neither result is statistically significant: there is not sufficient evidence at that level to reject independence. The corrected statistic is smaller, and its p-value is larger, as expected. The correction changes the strength of the evidence but does not change this decision at the 0.05 level.
Worked Example: A Significant Result With Either Calculation
In a second hypothetical study, 20 participants are observed in each group:
| Group | Outcome: Yes | Outcome: No | Total |
|---|---|---|---|
| Group A | 18 | 2 | 20 |
| Group B | 8 | 12 | 20 |
| Total | 26 | 14 | 40 |
Under the null hypothesis of independence, expected counts are 13 for each Yes cell and 7 for each No cell. Each expected count is at least 5. Assume independent observations and valid, mutually exclusive categories, so the chi-square approximation is appropriate. Every observed count differs from expectation by 5 in absolute value.
The Pearson statistic is
The continuity-corrected difference in each cell is \(5-0.5=4.5\), so
For \(df=1\), the Pearson p-value is approximately 0.00092 and the Yates p-value is approximately 0.0028. Both are below 0.05, so both calculations provide evidence against independence at that significance level. The corrected result gives weaker evidence, but not enough to change the decision in this example.
Worked Example: When the Correction Reduces the Statistic to Zero
A third hypothetical 2×2 table has these observed counts:
| Group | Outcome: Yes | Outcome: No | Total |
|---|---|---|---|
| Group A | 11 | 9 | 20 |
| Group B | 10 | 10 | 20 |
| Total | 21 | 19 | 40 |
Under independence, the expected counts in each row are 10.5 for Yes and 9.5 for No. These expected counts are all greater than 5. Assume independent observations and mutually exclusive, exhaustive categories. The observed counts differ from their expected values by 0.5 in every cell.
The uncorrected statistic is
For Yates, each adjusted difference is \(\max(0,0.5-0.5)=0\). Thus,
The Pearson p-value with \(df=1\) is approximately 0.752; the corrected p-value is \(P(\chi^2_1\ge 0)=1\). Neither provides evidence against independence at \(\alpha=0.05\). A corrected statistic of zero can occur when every observed count is within 0.5 of expectation. It is a consequence of this adjustment, not evidence that the null hypothesis has been proved true.
Using the Correction Appropriately
Yates continuity correction is specifically a convention for the 2×2 Pearson chi-square test with one degree of freedom. When it is used, apply it to all four cells and state that the reported statistic is corrected. When comparing results, use the same table, null hypothesis, and degrees of freedom; otherwise the change in p-value cannot be attributed solely to the correction.
The conditions for chi-square inference still matter. Observations should be independent, the categories should define the table correctly, and expected counts should be adequate for the chi-square approximation. The correction does not increase expected counts, make dependent observations independent, or make a poorly designed sample representative. If expected counts are too small, consult the appropriate alternative methods rather than treating Yates correction as a fix.
The correction is also not a license to choose whichever calculation gives a preferred conclusion. A report should follow the analysis plan or the relevant statistical convention and identify whether the statistic is corrected. In a 2×2 table, readers may encounter either a Pearson statistic or a continuity-corrected statistic, and the distinction can matter when results are near a chosen significance threshold.
Common Mistakes
- Subtracting 0.5 from the signed difference. The correction uses the absolute difference \(|O-E|\), then subtracts 0.5. The direction of the difference does not determine whether the correction increases or decreases the statistic.
- Subtracting 0.5 from the expected count. The expected counts remain unchanged. Only the absolute observed-minus-expected differences are adjusted.
- Forgetting the zero floor. Use \(\max(0,|O-E|-0.5)\). A negative adjusted difference is not squared as if it were a nonzero contribution.
- Expecting a smaller p-value after correction. The corrected statistic cannot exceed Pearson's statistic; with the same right-tail distribution, its p-value cannot be smaller.
- Treating the correction as a solution to sparse counts. It changes a calculation, not the adequacy of the chi-square approximation or the study design.
Check Your Understanding
Try these questions using the definitions and results above.
- In the Yates formula, what quantity is reduced by 0.5: the observed count, the expected count, or the absolute difference between them?
- If a cell has \(O=12\) and \(E=9.5\), what adjusted absolute difference is used in its corrected contribution?
- Why must the adjusted difference be set to zero when \(|O-E|<0.5\)?
- For a 2×2 test, explain why the corrected p-value cannot be smaller than the uncorrected Pearson p-value.
- Does applying Yates correction make a table with inadequate expected counts suitable for the chi-square approximation? Explain.