Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/expSampleSize.R
Estimates the sample size based on the expected power for a variety of study designs used in bioequivalence studies. See known.designs for the study designs covered.
1 2 3 4 
alpha 
Significance level (onesided). Commonly set to 0.05. 
targetpower 
Power to achieve at least. Must be >0 and <1. Typical values are 0.8 or 0.9. 
logscale 
Should the data used on logtransformed or on original scale? 
theta0 
Assumed ‘true’ (or ‘observed’ in case of 
theta1 
Lower (bio)equivalence limit. 
theta2 
Upper (bio)equivalence limit. 
CV 
In case of If In case of crossover studies this is the withinsubject CV, in case of a parallelgroup design the CV of the total variability. 
design 
Character string describing the study design. 
robust 
Defaults to FALSE. With that value the usual degrees of freedom will be used. 
prior.type 
Specifies which parameter uncertainty should be accounted for. In case of

prior.parm 
A list of parameters expressing the prior information about the
variability and/or treatment effect. Possible components are 
method 
Defaults to 
print 
If 
details 
If 
The sample size is calculated based on iterative evaluation of expected power.
The starting value of the sample size search is taken from a large sample
approximation if prior.type = "CV"
. Otherwise, an empirical start value is
obtained. Note that in case of prior.type = "both"
the calculation may
still take several seconds.
Note also that the expected power is always bounded above by the socalled
probability of technical success (PTS) which may be a value less than 1.
Therefore, it may be possible that it is either not possible to calculate the
required sample size at all or that the sample size gets very large
if the given targetpower is less but close to the PTS.
The estimated sample size gives always the total number of subjects (not subject/sequence in crossovers or subjects/group in parallel designs – like in some other software packages).
A data.frame with the input values and the result of the sample size estimation.
The Sample size
column contains the total sample size in case of all
designs implemented.
B. Lang, D. Labes
Grieve AP. Confidence Intervals and Sample Sizes. Biometrics. 1991;47:1597–603. doi: 10.2307/2532411
O’Hagan, Stevens, JW, Campell MJ. Assurance in Clinical Trial Design. Pharm Stat. 2005;4:187–201. doi: 10.1002/pst.175
Julious SA, Owen RJ. Sample size calculations for clinical studies allowing for uncertainty in variance. Pharm Stat. 2006;5:29–37. doi: 10.1002/pst.197
Julious SA. Sample sizes for Clinical Trials. Boca Raton: CRC Press / Chapman & Hall; 2010.
Bertsche A, Nehmitz G, Beyersmann J, Grieve AP. The predictive distribution of the residual variability in the linearfixed effects model for clinical crossover trials. Biom J. 2016;58(4):797–809. doi: 10.1002/bimj.201500245
Box GEP, Tiao GC. Bayesian Inference in Statistical Analysis. Boston: AddisonWesley; 1992.
Held L, Sabanes Bove D. Applied Statistical Inference. Likelihood and Bayes. Berlin, Heidelberg: Springer; 2014. doi: 10.1007/9783642378874
Senn S. Crossover Trials in Clinical Research. Chichester: John Wiley & Sons; 2^{nd} edition 2002.
Zierhut ML, Bycott P, Gibbs MA, Smith BP, Vicini P. Ignorance is not bliss: Statistical power is not probability of trial success. Clin Pharmacol Ther. 2015;99:356–9. doi: 10.1002/cpt.257
exppower.TOST, known.designs, sampleN.TOST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  # Classical 2x2 crossover, target power = 80%,
# BE limits 80 ... 125%, assumed true BE ratio = 95%,
# intrasubject CV=30% estimated from prior 2x2 trial
# with m = 30 subjects
expsampleN.TOST(CV=0.3, prior.parm = list(m = 30, design = "2x2"))
# > gives n = 42 with achieved expected power 0.806262
# Compare this to the usual sample size with CV assumed known ('carved in stone')
sampleN.TOST(CV=0.3)
# > gives n = 40 subjects
# Compare this to the case where uncertainty is accounted for CV and theta0
# Not run due to timing policy of CRAN  may run several seconds
expsampleN.TOST(CV=0.3, prior.parm = list(m = 30, design = "2x2"),
prior.type = "both")
# > gives n = 72 subjects
# More than one CV with corresponding degrees of freedom
# other settings as above in first example
CVs < c(0.25, 0.3)
dfs < c(22, 10)
expsampleN.TOST(CV=CVs, prior.parm = list(df = dfs))
# > gives a pooled CV=0.2664927 with df=32
# and a sample size n=34 with achieved expected power 0.812653 exact
# achieved expected power 0.815019 approximate acc. Julious

++++++++++++ Equivalence test  TOST ++++++++++++
Sample size est. with uncertain CV

Study design: 2x2 crossover
logtransformed data (multiplicative model)
alpha = 0.05, target power = 0.8
BE margins = 0.8 ... 1.25
Ratio = 0.95
CV = 0.3 with 28 df
Sample size (ntotal)
n exp. power
42 0.806262
+++++++++++ Equivalence test  TOST +++++++++++
Sample size estimation

Study design: 2x2 crossover
logtransformed data (multiplicative model)
alpha = 0.05, target power = 0.8
BE margins = 0.8 ... 1.25
True ratio = 0.95, CV = 0.3
Sample size (total)
n power
40 0.815845
++++++++++++ Equivalence test  TOST ++++++++++++
Sample size est. with uncertain CV and theta0

Study design: 2x2 crossover
logtransformed data (multiplicative model)
Design characteristics:
df = n2, design const. = 2, step = 2
alpha = 0.05, target power = 0.8
BE margins = 0.8 ... 1.25
Ratio = 0.95 with 28 df
CV = 0.3 with 28 df
Upper bound of expected power = 0.983772
Sample size search (ntotal)
n exp. power
Search for improved starting value based on nct approximation for conditional power:
74 0.810004
70 0.799593
72 0.804948
Final search:
72 0.804948
70 0.799593
2 iterations
72 0.804948
Exact expected power calculation.
++++++++++++ Equivalence test  TOST ++++++++++++
Sample size est. with uncertain CV

Study design: 2x2 crossover
logtransformed data (multiplicative model)
alpha = 0.05, target power = 0.8
BE margins = 0.8 ... 1.25
Ratio = 0.95
CV(pooled) = 0.2664927 with 32 df
Sample size (ntotal)
n exp. power
34 0.812653
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.