Yates's correction for continuity (source code)

= Yates's correction for continuity
{c}
{title2=$X_Y^2=\sum_{i,j}(\max\{|O_{ij}-E_{ij}|-1/2,0\})^2/E_{ij}$}
{wiki}

= Yates continuity correction
{c}
{synonym}

For a two-by-two <contingency table>, subtracting one half from each absolute observed-minus-expected count difference, with truncation at zero, gives the displayed corrected <Pearson chi-squared statistic>. Expected counts use the independence model $E_{ij}=O_{i+}O_{+j}/N$. The subtraction compensates approximately for using a continuous <chi-squared distribution> for discrete counts. It can make the test conservative. The corrected statistic should be distinguished from the ordinary uncorrected <Pearson chi-squared statistic>.