Calculates the necessary sample size to have at least a given power based on Fieller<U+2019>s confidence (‘fiducial’) interval.
sampleN.RatioF(alpha = 0.025, targetpower = 0.8, theta1 = 0.8, theta2,
theta0 = 0.95, CV, CVb, design = "2x2", print = TRUE,
details = FALSE, imax=100, setseed=TRUE)
Type I error probability. Defaults here to 0.025 because this function is intended for studies with clinical endpoints.
Power to achieve at least. Must be >0 and <1. Typical values are 0.8 or 0.9.
Lower bioequivalence limit. Typically 0.8 (default).
Upper bioequivalence limit. Typically 1.25.
Is set to 1/theta1
if missing.
‘True’ or assumed T/R ratio. Typically set to 0.95.
Coefficient of variation as ratio. In case of design="parallel"
this is
the CV of the total variability, in case of design="2x2"
the intra-subject
CV (CVw in the reference).
CV of the between-subject variability. Only necessary for design="2x2"
.
A character string describing the study design.
design="parallel"
or design="2x2"
allowed for a two-parallel
group design or a classical TR|RT crossover design.
If TRUE
(default) the function prints its results. If FALSE
only
a data.frame with the results will be returned.
If TRUE
the steps during sample size calculations will be shown.
Defaults to FALSE
.
Maximum number of steps in sample size search. Defaults to 100. Adaption only in rare cases needed.
If set to TRUE
the dependence of the power from the state of the random number
generator is avoided.
A data.frame with the input values and results will be returned. The sample size n returned is the total sample size for both designs.
The sample size is based on exact power calculated using the bivariate
non-central t-distribution via function pmvt
of the package mvtnorm
.
Due to the calculation method used in package mvtnorm these
probabilities are dependent from the state of the random number generator
within the precision of the power.
The CV(within) and CVb(etween) in case of design="2x2"
are obtained
via an appropriate ANOVA from the error term and from the difference
(MS(subject within sequence)-MS(error))/2
.
Hauschke D, Kieser M, Diletti E, Burke M. Sample size determination for proving equivalence based on the ratio of two means for normally distributed data. Stat Med. 1999;18(1):93--105. doi: 10.1002/(SICI)1097-0258(19990115)18:1<93::AID-SIM992>3.0.CO;2-8.
Hauschke D, Steinijans V, Pigeot I. Bioequivalence Studies in Drug Development. Chichester: Wiley; 2007. Chapter 10.
European Agency for the Evaluation of Medicinal Products, CPMP. Points to Consider on Switching between Superiority and Non-Inferiority. London, 27 July 2000. CPMP/EWP/482/99
# NOT RUN {
# sample size for a 2x2 cross-over study
# with CVw=0.2, CVb=0.4
# alpha=0.025 (95% CIs), target power = 80%
# 'true' ratio = 95%, BE acceptance limits 80-125%
# using all the defaults:
sampleN.RatioF(CV = 0.2, CVb = 0.4)
# gives n=28 with an achieved power of 0.807774
# see Hauschke et.al. (2007) Table 10.3a
# sample size for a 2-group parallel study
# with CV=0.4 (total variability)
# alpha=0.025 (95% CIs), target power = 90%
# 'true' ratio = 90%, BE acceptance limits 75-133.33%
sampleN.RatioF(targetpower = 0.9, theta1 = 0.75,
theta0 = 0.90, CV = 0.4, design = "parallel")
# gives n=236 with an achieved power of 0.900685
# see Hauschke et.al. (2007) Table 10.2
# a rather strange setting of ratio0! have a look at n.
# it would be better this is not the sample size but your account balance ;-).
sampleN.RatioF(theta0 = 0.801, CV = 0.2, CVb = 0.4)
# }
Run the code above in your browser using DataLab