Power of a two-sample rare-event comparison (source code)

= Power of a two-sample rare-event comparison

For two <independent random variables>[independent] <statistical sample>[samples] of size $n$ with <event> <probability>[probabilities] $p_0,p_1$, put $\delta=p_0-p_1$, $\bar p=(p_0+p_1)/2$, $s_0^2=2\bar p(1-\bar p)/n$ and $s_1^2=[p_0(1-p_0)+p_1(1-p_1)]/n$. The <normal approximation> to a two-sided level-$\alpha$ test has <statistical power>[power]
$$
1-\Phi\left(\frac{z_{1-\alpha/2}s_0-\delta}{s_1}\right)+\Phi\left(\frac{-z_{1-\alpha/2}s_0-\delta}{s_1}\right).
$$
For rare <events>, <independent random variables>[independent] <Poisson distributions> approximate the counts. Conditional on their total, the null count allocation is <binomial distribution> with <probability> one half; under the alternative the allocation <probability> is $p_0/(p_0+p_1)$. Averaging its exact rejection <probability> over the alternative total supplies a discrete <statistical power>[power] calculation.

// Target: probability-theory.bigb