Menu

Inputs

Calculate Sample Size Needed to Test 1 Proportion: 1-Sample Equivalence

This calculator is useful when we wish to test whether a proportion, pp, is different from a gold standard reference value, p0p_0. For example, we may wish to test whether a new product is equivalent to an existing, industry standard product. Here, the 'burden of proof', so to speak, falls on the new product; that is, equivalence is actually represented by the alternative, rather than the null hypothesis.
H0:pp0δH_0: |p - p_0| \ge \delta
H1:pp0<δH_1: |p - p_0| < \delta

Formulas

This calculator uses the following formulas to compute sample size and power, respectively: n=p(1p)(z1α+z1β/2pp0δ)2n = p(1-p) \left( \frac{z_{1-\alpha} + z_{1-\beta/2}}{|p - p_0| - \delta} \right)^2 1β=2[Φ(zz1α)+Φ(zz1α)]1,z=pp0δp(1p)n1 - \beta = 2 \left[ \Phi \left( z - z_{1-\alpha} \right) + \Phi \left( -z - z_{1-\alpha} \right) \right] - 1 \quad , \quad z = \frac{|p - p_0| - \delta}{\sqrt{\frac{p(1-p)}{n}}} where nn is sample size p0p_0 is the comparison value Φ\Phi is the standard Normal distribution function Φ1\Phi^{-1} is the standard Normal quantile function α\alpha is Type I error β\beta is Type II error, meaning 1β1-\beta is power δ\delta is the testing margin

R Code

1p=0.6
2p0=0.6
3delta=0.2
4alpha=0.05
5beta=0.20(n=p*(1-p)*((qnorm(1-alpha)+qnorm(1-beta/2))/(abs(p-p0)-delta))^2)
6ceiling(n) # 52
7z=(abs(p-p0)-delta)/sqrt(p*(1-p)/n)(Power=2*(pnorm(z-qnorm(1-alpha))+pnorm(-z-qnorm(1-alpha)))-1)

References

Chow S, Shao J, Wang H. 2008. Sample Size Calculations in Clinical Research. 2nd Ed. Chapman & Hall/CRC Biostatistics Series. page 87.