Where g 1 {\displaystyle g_{1}} and g 2 {\displaystyle g_{2}} are the two proportions and n 1 {\displaystyle n_{1}} and n 2 {\displaystyle n_{2}} are the sample sizes:
z = g 1 − g 2 g 1 ( 1 − g 1 ) n 1 + g 2 ( 1 − g 2 ) n 2 {\displaystyle z={\frac {g_{1}-g_{2}}{\sqrt {{\frac {g_{1}(1-g_{1})}{n_{1}}}+{\frac {g_{2}(1-g_{2})}{n_{2}}}}}}}
where p = 2 ( 1 − Φ ( | z | ) ) {\displaystyle p=2(1-\Phi (|z|))} .