nNormal()
computes a fixed design sample size for comparing 2 means where variance is known. T
The function allows computation of sample size for a non-inferiority hypothesis.
Note that you may wish to investigate other R packages such as the pwr
package which uses the t-distrnNormal(delta1=1,sigma=1.7,sigalt=NULL,alpha=.025,beta=.1,ratio=1, sided=1,
n=NULL,delta0=0)
NULL
.n
is provided.NULL
(default) then sample size is computed.n
is NULL
(default), total sample size (2 arms combined) is computed. Otherwise, power is cnNormal()
computes sample size for comparing two normal means when the variance for observations in# EXAMPLES
# equal variances
nNormal(delta1=.5,sigma=1.1,alpha=.025,beta=.2)
# unequal variances
nNormal(delta1=.5,sigma=1.1,sigalt=2,alpha=.025,beta=.2)
# unequal sample sizes
nNormal(delta1=.5,sigma=1.1,alpha=.025,beta=.2, ratio=2)
# non-inferiority assuming a better effect than null
nNormal(delta1=.5,delta0=-.1,sigma=1.2)
Run the code above in your browser using DataLab