This calculator is useful for tests concerning whether a mean, $\mu$, is equal to a reference value, $\mu_0$. The Null and Alternative hypotheses are
This calculator uses the following formulas to compute sample size and power, respectively: $$n=\left(\sigma\frac{z_{1-\alpha/2}+z_{1-\beta}}{\mu-\mu_0}\right)^2$$ $$1-\beta= \Phi\left(z-z_{1-\alpha/2}\right)+\Phi\left(-z-z_{1-\alpha/2}\right) \quad ,\quad z=\frac{\mu-\mu_0}{\sigma/\sqrt{n}}$$ where
R code to implement these functions:
mu=2 mu0=1.5 sd=1 alpha=0.05 beta=0.20 (n=(sd*(qnorm(1-alpha/2)+qnorm(1-beta))/(mu-mu0))^2) ceiling(n)# 32 z=(mu-mu0)/sd*sqrt(n) (Power=pnorm(z-qnorm(1-alpha/2))+pnorm(-z-qnorm(1-alpha/2)))
Chow S, Shao J, Wang H. 2008. Sample Size Calculations in Clinical Research. 2nd Ed. Chapman & Hall/CRC Biostatistics Series. page 51.
Rosner B. 2010. Fundamentals of Biostatistics. 7th Ed. Brooks/Cole. page 232.