Learn R Programming

gset (version 1.1.0)

nfix: sample size calculation for equivalence studies

Description

calculates sample size for equivalence studies in the traditional non-sequential setting

Usage

nfix(r, l, u, theta, sigma, type1, type2, nrange = c(0, 1000))

Arguments

r
sampling ratio of the two groups. For paired samples (such as in crossover studies), r=1
l
lower equivalence bound as given in the equivalence hypothesis
u
upper equivalence bound as given in the equivalence hypothesis
theta
true mean difference between 2 groups
sigma
between-subject standard deviation of the response variable for two independent groups; within subject standard deviation of the response variable for paired groups
type1
overall Type I error rate
type2
overall Type II error rate
nrange
a 2-dimensional vector containing the end-points of the interval from which thesample size will be solved. Default crange = c(0,1000)

Value

n1
sample size in group 1
n2
sample size in group 1

References

Liu, F. and Li, Q. (2014), Sequential Equivalence Testing based on the Exact Distribution of Bivariate Noncentral $t$-statistics, Computational Statistics and Data Analysis, 77:14-24

Liu, F. (2014), gset: an R package for exact sequential test of equivalence hypothesis based on bivariate non-central $t$-statistics, the R Journal (to appear)

See Also

nonbinding,binding,equivonly,nminmax, oc,figureE,figureEF

Examples

Run this code
 ## Not run: 
#   L <- -0.2
#   U <- 0.2
#   theta <- 0
#   sigma <- 0.4  
#   alpha <- 0.05
#   beta  <- 0.2
#   r<- 1 
#   n.fix <- nfix(r, L,U,theta,sigma,alpha,beta)
#   ## End(Not run)

Run the code above in your browser using DataLab