## Sample size required to estimate proportions $p_1-p_2$

The minimum sample size required to estimate the proportions $p_1-p_2$ is

```
$$
n =\big[p_1*(1-p_1)+p_2*(1-p_2)\big]\bigg(\frac{z}{E}\bigg)^2
$$
```

where

- $p_1$ is the proportion of successes in first group,
- $p_2$ is the proportion of successes in second group,
- $z$ is the $Z_{\alpha/2}$ and
- $E$ is the margin of error.