View on GitHub

memo

Binary test

Binary Test

Two sample binary test

\[\begin{eqnarray} \hat{p}_{j} := \frac{ \sum_{i=1}^{n_{j}} x_{j}^{i} }{ n_{j} } \end{eqnarray}\] \[\begin{eqnarray} \hat{p} := \frac{ n_{1} \hat{p}_{1} + n_{2} \hat{p}_{2} }{ n_{1} + n_{2} } \end{eqnarray}\]

Then

\[z := \frac{ \hat{p}_{1} - \hat{p}_{2} }{ \hat{p}(1 - \hat{p}) \left( \frac{1}{n_{1}} + \frac{1}{n_{2}} \right) } .\]

$z$ asymptotically follows normal distribution. Let $Z$ be a random variable with normal distribution. If $P(Z \le z) \le \alpha$, the null hypothesis is rejected.

Reference