Chi-Square CalculatorChi-Square Calculator
Guide

The Yates Continuity Correction

The Yates correction subtracts 0.5 from every gap between observed and expected counts in a 2x2 table. It explains most "my answer differs from R" puzzles.

Checked on November 21, 2026. Results computed by our statistics engine, version 1.0.0.

In short

  • The formula and the cap R applies
  • The same table with and without it
  • What current advice says
On this page

What the correction does

Counts are whole numbers, but the chi-square distribution is continuous. In 1934 Frank Yates proposed shrinking each gap |O − E| by 0.5 before squaring, to make the continuous curve match the discrete counts better in 2x2 tables (Yates 1934): χ²Y = Σ (|O − E| − 0.5)² / E.

R caps the adjustment so it never exceeds the gap itself: it subtracts min(0.5, |O − E|), so a cell that already matches its expected count is not pushed the other way (R chisq.test source). The correction is only ever applied to 2x2 tables; SciPy applies it whenever the test has 1 degree of freedom (SciPy chi2_contingency).

One table, both ways

Column 1Column 2
Row 1125
Row 277

This is the 2x2 example from R's documentation, entered row by row (R reference output).

Versionχ²p-value
Pearson, uncorrected1.37160.2415
Yates-corrected0.64110.4233
N−1 (Campbell)1.32740.2493
Fisher's exact testexact0.2883

The correction roughly halves χ² here and raises p from 0.242 to 0.423. Neither is significant, so the conclusion does not change, but the numbers are very different. R prints the corrected p-value, 0.4233 to four decimals, for chisq.test(matrix(c(12, 5, 7, 7), ncol = 2)), because correct = TRUE is the default.

Reproducing both in R and Python

tab <- matrix(c(12, 5, 7, 7), nrow = 2, byrow = TRUE)
chisq.test(tab)                  # Yates-corrected (default)
chisq.test(tab, correct = FALSE) # Pearson, uncorrected
from scipy.stats import chi2_contingency
tab = [[12, 5], [7, 7]]
print(chi2_contingency(tab).pvalue)                    # corrected (default)
print(chi2_contingency(tab, correction=False).pvalue)  # uncorrected

R's documentation enters this table as matrix(c(12, 5, 7, 7), ncol = 2), which fills by column, so its first row is 12 and 7. That is the transpose of the table above, and χ² is the same either way.

Why many statisticians advise against it

The correction makes the test conservative: its real false-positive rate is usually well below the nominal 5%, so it misses real associations more often than it should. Campbell's 2007 study of 2x2 tables found that the N−1 chi-square, or Fisher's exact test when an expected count is below 1, performed better than the Yates-corrected test (Campbell 2007).

It survives because it is the default in R and SciPy and because textbooks still teach it. That is why this site shows the uncorrected and corrected statistics together, with Fisher's exact test, rather than hiding one of them.

When the cap matters

In the constructed table 3 and 0 over 0 and 3, every expected count is 1.5 and every gap is 1.5, so the full 0.5 is subtracted: χ²Y = 4 × (1.5 − 0.5)² / 1.5 = 2.6667, against an uncorrected 6.00. Only when a gap is smaller than 0.5 does R's cap change the arithmetic.

What to report

  • Decide before you look at the data, and name the version: "Pearson chi-square without continuity correction" or "with Yates' correction".
  • If any expected count is below 1, report Fisher's exact test instead.
  • Use the 2x2 calculator to see all versions together, and the APA guide for the reporting format.

Sources