Sample size for comparing two proportions (source code)

= Sample size for comparing two proportions
{title2=$n\simeq[z_{1-\alpha/2}\sqrt{2\bar p(1-\bar p)}+z_{1-\beta}\sqrt{p_1(1-p_1)+p_0(1-p_0)}]^2/(p_1-p_0)^2$}

For equal <independent random variables>[independent] <binomial distribution>[binomial samples], the displayed normal-approximation size per group targets a two-sided <significance level> $\alpha$ and <statistical power>[power] $1-\beta$ at specified alternative rates, with $\bar p=(p_1+p_0)/2$. Its first <variance> term sets the <critical value>[null critical value] and its second the <sampling distribution>[alternative distribution]. A numerical <sample size> is not determined by an effect ratio alone; <statistical power>[power], sidedness, allocation and baseline rates must also be specified. Rare-event discreteness and clustered designs can materially change the achieved <statistical power>[power].