## CI for difference between two population proportions

Let $X_1$ be the observed number of individuals possessing certain attributes (number of successes) in arandom sample of size $n_1$ from a large population with population proportion $p_1$ and let $X_2$ be the observed number of individuals possessing certain attributes (number of successes) in a random sample of size $n_2$ from a large population with population proportion $p_2$. The two sample are independent.

## Formula

$100(1-\alpha)$% confidence interval for the difference $(p_1-p_2)$ is

`$(\hat{p}_1-\hat{p}_2) - E \leq (p_1 -p_2) \leq (\hat{p}_1 -\hat{p}_2)+ E$`

where,

`$\hat{p_1}=\dfrac{X_1}{n_1}$`

and`$\hat{p_2}=\dfrac{X_2}{n_2}$`

are the observed proportion for two samples,`$E = Z_{\alpha/2} \sqrt{\dfrac{\hat{p}_1*(1-\hat{p}_1)}{n_1}+\dfrac{\hat{p}_2*(1-\hat{p}_2)}{n_2}}$`

is the margin of error,`$1-\alpha$`

is the confidence coefficient,`$Z_{\alpha/2}$`

is the critical value of $Z$.