Solution (source code)

= Solution

The pooled <Wald test> statistic is
$$
T=\frac{p_1-p_0}
{\sqrt{\bar p(1-\bar p)(1/n_1+1/n_0)}}.
$$
In asymptotic calculations one replaces $\bar p$ by its probability limit $\bar\pi=(n_1\pi_1+n_0\pi_0)/(n_1+n_0)$.