D=ˆp1-ˆp2
where
ˆp1=X1n1andˆp2=X2n2
SED=√ˆp1(1-ˆp1)n1+ˆp2(1-ˆp2)n2
and the margin of error for confidence level C is
m=z*SED
where z* is the value for the standard Normal density curve with area C between -z* and z*.
(ˆp1-ˆp2)±m
We recommend using this method when the number of successes and the number of failures in both samples are at least 10.
z=ˆp1-ˆp2SEDp
with P-values from the N(0,1) distribution. In this statistic,
SEDp=√ˆp(1-ˆp)(1n1+1n2)
where ˆp is the pooled estimate of the common value of p1 and p2,
ˆp=X1+X2n1+n2
We recommend using this test when the number of successes and the number of failures in each of the samples are at least 5.
n=(z*m)2(p*1(1-p*1)+p*2(1-p*2))
Here z* is the critical value for confidence C, and p*1 and p*2 are guessed values for p1 and p2, the proportions of successes in the future sample.
n=(12)(z*m)2
RR=ˆp1ˆp2
Confidence intervals for relative risk are an alternative to confidence intervals for the difference when we want to compare two proportions.