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 testing whether the mean difference between two groups is different from 0:

$H_0:\mu_2-\mu_1=0$ versus $H_1:\mu_2-\mu_1\neq0$
.
where the ratio between the sample sizes of the two groups is
$$\kappa=\frac{n_1}{n_2}$$

Sample Size

Power

X-axis

min

max

This sample size calculator uses the following formula: $$ n_1=\kappa n_2 \;\text{ and }\; n_2=\left(1+\frac{1}{\kappa}\right) \left(\sigma\frac{\Phi^{-1}(\alpha/2)+\Phi^{-1}(\beta)}{\mu_1-\mu_0}\right)^2$$ where

  • $n$ is sample size
  • $\kappa=n_1/n_2$ is the matching ratio
  • $\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

R code to implement this function:

mu0=5
mu1=10
kappa=1
sd=10
alpha=0.05
beta=0.20
(n=ceiling((1+1/kappa)*(sd*(qnorm(alpha/2)+qnorm(beta))/(mu1-mu0))^2)) # 63

Reference: Chow, page 58