The correction adjust the statistic toward the zero.
p1 < p2: F = 1.
p1 > p2: F = -1.
p1 = p2: F = 0.
| Cont = | F | ( | 1 | + | 1 | ) |
| 2 | n1 | n2 |
The continuity correction cannot change the direction of the statistic i.e. correct positive statistic to negative, or vice versa.
Cont = Min(Cont,Abs(p1 - p2)).
| Z = | p̂1 - p̂2 + Cont |
| √( p̂(1-p̂)(1/n1 + 1/n2) ) |
| Binomial distribution - the probability for event within each group is identical | |
| Expected difference d between the populations's average is known |
| p̂1, p̂2 the sample probabilities or x1, x2 the number of successes | |
| n1,n2 - Sample size of group1 and group2 |
The following R code should produce the same results:
The prop.test uses the Chi-squared statistic with one degree of freedom, which is exactly as using the Z test: z2=χ2(1)