Continuity correction in proportion test Can you please clarify to me when to use continuity correction in proportion test please? I'm using this formula in R and I want to know the difference in the option correct= TRUE or FALSE. Also, I noticed the p value with correction goes up, so I'm just concerned if I'm using this option (TRUE or FALSE) correctly? how this might impacts my analysis. Any help is really appreciated!
prop.test(x=c(84,105.5),n=c(99,146),correct = TRUE)

Thank you
 A: There are many opinions on how to best test for 2 x 2 contingency tables like this. Here the prop.test implements a chi-squared test. The issue is that in some cases data from a 2 x 2 contingency table isn't well approximated by the chi-squared distribution under the null. This can lead to p-values that are too small. Yates continuity correction adjusted for this but can lead to p-values that are too large.
There are other tests that you could use (Fisher's exact test being one) but another option in R is to simulate the distribution under the null and utilize this empirical distribution to calculate the p-value.
mat <- matrix(data = c(84, (99 - 84), 105.5, (146 - 105.5)), ncol = 2)

chisq.test(x = mat, correct = FALSE)

chisq.test(x = mat, correct = TRUE)

chisq.test(x = mat, simulate.p.value = TRUE)

Without the continuity correction, the p-value is 0.021. With the continuity correction, it's 0.031. Simulating the distribution produces a p-value of ~ 0.026. (One issue with this approach is that in R this simulation samples from a hypergeometric distribution which may not approximate your sampling situation.)
For other good threads on this see: Yates continuity correction for 2 x 2 contingency tables and Given the power of computers these days, is there ever a reason to do a chi-squared test rather than Fisher's exact test?
A: In order to consider what you asked, without additional material, consider the $2\times 2$ table TAB as follows:
TAB = rbind(c(80,90), c(20,15))
TAB
     [,1] [,2]
[1,]   80   90
[2,]   20   15

A chi-squared test of independence with the Yates
correction is as follows:
chisq.test(TAB)

        Pearson's Chi-squared test 
        with Yates' continuity correction

data:  TAB
X-squared = 0.81215, df = 1, p-value = 0.3675

In R, prop.test compares proportions $80/100$ and
$90/105.$  A two-sided test is equivalent to the
chi-squared test above--if the 'continuity correction'
is used. Notice that the chi-squared statistic and the P-value are exactly the same. [The procedure prop.test gives more
detail.]
prop.test(c(80,90), c(100,105), cor=T)

        2-sample test for equality of proportions 
        with continuity correction

data:  c(80, 90) out of c(100, 105)
X-squared = 0.81215, df = 1, p-value = 0.3675
alternative hypothesis: two.sided
95 percent confidence interval:
 -0.16998808  0.05570236
sample estimates:
   prop 1    prop 2 
0.8000000 0.8571429 

For sufficiently large counts, Yates' correction is not
needed. (And in my opinion too conservative.) If parameter
cor=F is used to disable the correction, the chi-squared
test is as follows:
chisq.test(TAB, cor=F)

        Pearson's Chi-squared test

data:  TAB
X-squared = 1.1813, df = 1, p-value = 0.2771

Similarly, if cor=F is used, prop.test gives
the same test statistic and P-value as just above.
prop.test(c(80,90), c(100,105), cor=F)

        2-sample test for equality of proportions 
        without continuity correction

data:  c(80, 90) out of c(100, 105)
X-squared = 1.1813, df = 1, p-value = 0.2771
alternative hypothesis: two.sided
95 percent confidence interval:
 -0.16022617  0.04594046
sample estimates:
   prop 1    prop 2 
0.8000000 0.8571429 

Note: Simulated test statistics in case of expected counts
below 5, and the use of Fisher's exact test are interesting
topics, but have no direct connection with use or non-use of
the Yates correction.
