## HyLown Power and Sample Size Calculators

Good News! These calculators have earned their own website! We'll leave these calculators here for now, but for our latest calculators please visit

PowerAndSampleSize.com.

For either a non-inferiority (when $\delta>0$) or a superiority test(when $\delta<0$), where

$H_0:\mu-\mu_0\le\delta$ versus $H_1:\mu-\mu_0>\delta$

and $\delta$ is the superiority or non-inferiority margin.

Sample Size

Power

X-axis

min

max

This sample size calculator uses the following formula: $$n=\left(\sigma\frac{\Phi^{-1}(\alpha)+\Phi^{-1}(\beta)}{\mu_1-\mu_0-\delta}\right)^2$$ where

• $n$ is sample size
• $\sigma$ is standard deviation
• $\Phi^{-1}$ is the standard Normal quantile function
• $\alpha$ is Type I error
• $\beta$ is Type II error, meaning $1-\beta$ is power
• $\delta$ is the testing margin

R code to implement this function:

mu0=1.5
mu1=2
delta=-0.5
sd=1
alpha=0.05
beta=0.20
(n=ceiling((sd*(qnorm(alpha)+qnorm(beta))/(mu1-mu0-delta))^2)) # 7

Reference: Chow, page 52