Difference of independent sample proportions (source code)

= Difference of independent sample proportions
{title2=$\widehat\delta=\widehat p_1-\widehat p_0$}

For two <independent> samples of <Bernoulli random variables>, the difference of their <sample proportions> estimates the difference of population <probabilities>. Since the samples are <independent>,
$$
\operatorname{Var}(\widehat p_1-\widehat p_0)=\frac{p_1(1-p_1)}{n_1}+\frac{p_0(1-p_0)}{n_0}.
$$
Substitution of the <sample proportions> gives a <standard error> for a large-sample <Wald confidence interval>. This interval is a descriptive comparison of the specified groups; a <causal effect> needs further assumptions. Sparse counts and <probabilities> near zero or one can make the <normal approximation> poor. Testing equality can instead use a null-pooled estimate of the common <probability> for the test's <standard error>.