Test statistics

t=p^xp^yp^0(1p^0)(1nx+1ny)t=\frac{\hat p_x - \hat p_y}{\sqrt{\hat p_0(1-\hat p_0)(\frac{1}{n_x} + \frac{1}{n_y})}}

follows N(0,1)\mathcal{N}(0,1) distribution under H0H_0 in large sample, i.e. np0(1p0)>5np_0(1-p_0)\gt 5, and

p^0=nxp^x+nyp^ynx+ny\hat p_0=\frac{n_x\hat p_x + n_y\hat p_y}{n_x+n_y}

reject H0H_0 if t>zαt\gt z_\alpha in (i)