Menu
Inputs
Test 1 Mean: 1-Sample, 2-Sided Equality
This calculator is useful for tests concerning whether a mean, , is equal to a reference value, . The Null and Alternative hypotheses are
Formulas
This calculator uses the following formulas to compute sample size and power, respectively:
where:
is sample size
is standard deviation
is the standard Normal distribution function
is the standard Normal quantile function
is Type I error
is Type II error, meaning is power
R Code
1mu=2
2mu0=1.5
3sd=1
4alpha=0.05
5beta=0.20
6(n=(sd*(qnorm(1-alpha/2)+qnorm(1-beta))/(mu-mu0))^2)
7ceiling(n)# 32
8z=(mu-mu0)/sd*sqrt(n)(Power=pnorm(z-qnorm(1-alpha/2))+pnorm(-z-qnorm(1-alpha/2)))References
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.