Tutorials › VEE Mathematical Statistics › Yates Continuity Correction for Two-by-Two Chi-Square Tests

VEE Mathematical Statistics · Classical Tests and Goodness of Fit · Tutorial 694 of 880

Yates Continuity Correction for Two-by-Two Chi-Square Tests

Calculate and interpret the Yates correction for a two-by-two chi-square test, including its purpose, effect on the statistic, and limitations.

Intermediate 11 min read

What You'll Learn

  • Calculate expected counts and the Yates-corrected statistic for a two-by-two table.
  • Distinguish the corrected statistic from the uncorrected Pearson statistic.
  • Explain why a half-unit adjustment is used for discrete counts.
  • Compare corrected and uncorrected test decisions using the same degrees of freedom.
  • Recognize when sparse expected counts call for caution rather than relying on the correction.

Why Correct a Two-by-Two Chi-Square Test?

The Pearson chi-square test compares observed counts with counts expected under a null hypothesis. Its reference distribution is continuous, but the data in a contingency table are discrete counts. In a two-by-two table with modest sample sizes, that difference can matter: the uncorrected Pearson statistic may suggest stronger evidence against the null than the discrete data justify. Yates' continuity correction adjusts the statistic to account for this discreteness.

The correction is specific to a two-by-two table. It does not change the null hypothesis, the table's expected counts, or its degrees of freedom. It changes how far the observed counts are treated as lying from their expected counts. As a result, the corrected statistic is usually smaller than the uncorrected statistic, though the size of the change depends on the table.

Definition: For a two-by-two table with observed counts \(O_{ij}\) and expected counts \(E_{ij}\) under the null hypothesis, the Yates-corrected Pearson statistic is $$ X^2_Y=\sum_{i=1}^{2}\sum_{j=1}^{2}\frac{(|O_{ij}-E_{ij}|-0.5)^2}{E_{ij}}. $$ The uncorrected Pearson statistic is $$ X^2_P=\sum_{i=1}^{2}\sum_{j=1}^{2}\frac{(O_{ij}-E_{ij})^2}{E_{ij}}. $$ The correction subtracts one-half from each absolute observed-minus-expected difference before squaring.

Model, Expected Counts, and Test Degrees of Freedom

Suppose each observational unit is classified by two categorical variables, each having two categories. For a test of independence, the null hypothesis is that the variables are independent in the population. For a test of homogeneity, the null hypothesis is that the category proportions are the same across the populations being compared. Either design produces a two-by-two table, and the same Yates calculation applies.

Assume the observations are independent, each unit contributes to exactly one cell, and the counts are tabulated consistently. For an independence test, expected counts are calculated from the observed margins under the null of independence. In a homogeneity test, they are calculated using the group totals and pooled category proportions under the null of equal proportions. In either case, for row \(i\), column \(j\), and total sample size \(N\),

$$ E_{ij}=\frac{(\text{row }i\text{ total})(\text{column }j\text{ total})}{N}. $$

For a two-by-two independence or homogeneity test, the degrees of freedom are \((2-1)(2-1)=1\). Applying Yates' correction does not change this. If the corrected statistic is compared with a chi-square reference distribution, the comparison still uses one degree of freedom. The validity of that approximate reference distribution depends on the sampling design and the adequacy of the chi-square approximation; the correction does not make every sparse table suitable for an approximation.

Why the Half-Unit Adjustment Appears

The adjustment has a continuity-based motivation. A count can only take integer values, while a chi-square reference distribution is continuous. When a continuous approximation is used to represent discrete counts, a boundary halfway between neighboring integers is a natural dividing point. Thus a count lying several units from its null expectation is treated as being about one-half unit closer to that expectation for the purpose of the approximation.

For example, if an observed count is 12 and its expected count is 8.5, the absolute difference is 3.5. The corrected difference is \(3.5-0.5=3.0\), not \(3.5\). The contribution to the corrected statistic is \(3.0^2/8.5\), whereas the uncorrected contribution is \(3.5^2/8.5\). The same adjustment is made separately for each of the four cells, using each cell's own expected count in the denominator.

In the usual two-by-two calculation, the formula is applied as written. If a table is so close to its expected counts that an adjusted difference becomes negative, squaring it does not make the adjustment a simple “shrink toward zero” rule in that cell. This is one reason to state the convention being used and to avoid treating the correction as a universal fix for small samples.

Worked Example: Comparing Corrected and Uncorrected Decisions

In a hypothetical study of two independent groups, each person either selects a redesigned information sheet or does not. The counts are shown below. Test the null hypothesis of equal selection proportions using the uncorrected and Yates-corrected statistics, and compare both decisions at the 5% significance level.

GroupSelectsDoes not selectTotal
Group A12820
Group B51520
Total172340

Step 1: Find expected counts. Under the null of equal proportions, use the row and column totals. The expected count for Group A selecting is \(20(17)/40=8.5\). The other expected counts are \(20(23)/40=11.5\), \(20(17)/40=8.5\), and \(20(23)/40=11.5\). Thus the expected table is \((8.5,11.5;8.5,11.5)\).

Step 2: Calculate the uncorrected statistic. The absolute differences in the four cells are all 3.5. Therefore,

$$ X^2_P=\frac{3.5^2}{8.5}+\frac{3.5^2}{11.5} +\frac{3.5^2}{8.5}+\frac{3.5^2}{11.5} =2\left(\frac{12.25}{8.5}\right)+2\left(\frac{12.25}{11.5}\right) =2.8824+2.1304=5.0128. $$

Step 3: Apply the correction cell by cell. Each corrected absolute difference is \(3.5-0.5=3.0\). Hence,

$$ X^2_Y=\frac{3^2}{8.5}+\frac{3^2}{11.5} +\frac{3^2}{8.5}+\frac{3^2}{11.5} =2\left(\frac{9}{8.5}\right)+2\left(\frac{9}{11.5}\right) =2.1176+1.5652=3.6829. $$

Step 4: Compare with the critical value. Both tests have one degree of freedom. The 5% upper-tail critical value is approximately 3.841. The uncorrected statistic \(5.0128\) exceeds 3.841, while the corrected statistic \(3.6829\) does not. Thus, at the 5% level, the uncorrected test rejects the null and the Yates-corrected test does not. The conclusion depends on which specified procedure is used; report the method rather than presenting the two decisions as interchangeable.

Check. The corrected statistic is smaller than the uncorrected statistic, as expected here, and both were compared using the same one degree of freedom.

Calculating the Statistic Efficiently

The safest method is to calculate the expected count for every cell, then apply the formula directly. In a two-by-two table, all four cells must be included. A shortcut based on the cross-product difference can be useful as a check, but it is easy to lose a factor or use the wrong total. Direct cell-by-cell calculation makes the source of each contribution visible.

1
Set up the table and null hypothesis.
Identify whether the question is about independence or homogeneity, and verify that the cells contain counts rather than percentages.
2
Calculate all four expected counts.
Use the appropriate row totals, column totals, and grand total under the null hypothesis.
3
Calculate both statistics if comparison is useful.
For \(X^2_P\), square each signed difference. For \(X^2_Y\), take the absolute difference, subtract 0.5, square, and divide by the expected count.
4
Make the test decision with one degree of freedom.
Use the significance level and reference procedure specified in the problem, and identify whether the statistic is corrected.

Worked Example: A Symmetric Table and a Calculation Check

A hypothetical safety program is evaluated in two groups of 60 participants each. In Group A, 34 participants complete a voluntary safety module and 26 do not. In Group B, 26 complete it and 34 do not. Calculate the expected counts and both Pearson statistics.

Method. Treat the data as a two-by-two homogeneity table under the null hypothesis of equal completion proportions.

Step 1: Margins and expected counts. The total sample size is \(N=60+60=120\). Each row total is 60, and each column total is also \(34+26=60\). Every expected count is therefore \(60(60)/120=30\).

Step 2: Uncorrected statistic. Each observed count differs from its expected count by 4. All four contributions are \(4^2/30=16/30=0.5333\). Thus,

$$ X^2_P=4\left(\frac{16}{30}\right)=\frac{64}{30}=2.1333. $$

Step 3: Yates-corrected statistic. Each absolute difference of 4 becomes \(4-0.5=3.5\). Each contribution is \(3.5^2/30=12.25/30=0.4083\). Therefore,

$$ X^2_Y=4\left(\frac{12.25}{30}\right)=\frac{49}{30}=1.6333. $$

Check. The four uncorrected contributions sum to \(4(0.5333)=2.1333\), not 1.0667. The corrected total, \(1.6333\), is also below the uncorrected total. The error to avoid is omitting one of the four equal cell contributions.

Limitations and Common Exam Traps

Yates' correction is often described as conservative because it commonly reduces the statistic and therefore makes rejection less likely. That tendency does not mean it is always the best procedure. The correction is designed for a two-by-two chi-square setting; it should not be applied automatically to larger contingency tables or to tests that do not use this statistic. It also does not replace checking the sampling assumptions or the expected-count conditions for a chi-square approximation.

When expected counts are very small, the corrected statistic may still be based on an inadequate chi-square approximation. Depending on the design and the question, an exact method may be more appropriate. The correction does not create information, repair dependent observations, or make the sampling design valid. In a large sample, its practical effect is often small relative to the uncorrected differences; in a smaller table, it can change a test decision, as the first example showed.

  • Subtracting 0.5 from the statistic. The half-unit adjustment is made to each absolute cell difference, not to the final value of \(X^2_P\).
  • Using signed differences before taking absolute values. The correction uses \(|O_{ij}-E_{ij}|\), then subtracts 0.5. Do not subtract 0.5 from a negative signed residual.
  • Leaving out cells or duplicating contributions. There are exactly four terms in each two-by-two statistic. Check that every observed cell is paired with its own expected count.
  • Changing the degrees of freedom. Yates' correction changes the statistic, not the table structure. The two-by-two test still has one degree of freedom.
  • Assuming the corrected test must be decisive. A smaller statistic can change a decision, but the conclusion still depends on the significance level, model assumptions, and suitability of the approximation.

A useful final check is to calculate the uncorrected statistic first, then the corrected statistic separately. For tables whose cell differences are at least one-half, the correction reduces each absolute difference before squaring, so the corrected total should not exceed the uncorrected total. If the result contradicts that check, revisit the absolute values and arithmetic.

Key takeaway: For a two-by-two Pearson chi-square test, Yates' continuity correction replaces each squared deviation \((O_{ij}-E_{ij})^2\) with \((|O_{ij}-E_{ij}|-0.5)^2\), retaining the cell's expected count in the denominator. It usually reduces the statistic, but it does not change the null hypothesis, degrees of freedom, or the need to check whether the chi-square approximation is suitable.

Check Your Understanding

For each problem, calculate the requested quantity using the stated two-by-two table. Round statistics to four decimal places.

  1. A hypothetical screening reminder is sent to two groups. The observed table is Group A: 9 respond and 11 do not; Group B: 11 respond and 9 do not. Find the Yates-corrected statistic. (Answer: 0.1000)
  2. Two independent groups in a hypothetical training evaluation have counts Group A: 14 complete and 6 do not; Group B: 6 complete and 14 do not. Find the Yates-corrected statistic. (Answer: 4.9000)
  3. In a hypothetical comparison, the table is Group A: 18 select an option and 12 do not; Group B: 12 select it and 18 do not. Find both the uncorrected and Yates-corrected statistics. (Answer: \(X^2_P=2.4000,\ X^2_Y=1.6667\))
  4. A hypothetical two-group study has counts Group A: 8 report an outcome and 12 do not; Group B: 4 report it and 16 do not. Find the four expected counts and the Yates-corrected statistic. (Answer: Expected counts \(6,14,6,14\); \(X^2_Y=1.0714\))
Clinical Biostats