power.TOST.sds: Power calculation of the BE decision with models...

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/power_TOST_sds.R


The power is obtained via subject data simulations.
Three models are implemented:


power.TOST.sds(alpha = 0.05, theta1, theta2, theta0, CV, n, 
               design = c("2x2", "2x2x2", "2x3x3", "2x2x4", "2x2x3"),
               design_dta = NULL, grps = 2, ngrp = NULL, gmodel = 2,
               nsims = 1e+05, details = FALSE, setseed = TRUE, progress)



Type I error probability, significance level. Conventionally mostly set to 0.05.


Lower BE limit. Defaults to 0.8 if not given explicitely.


Upper BE limit. Defaults to 1.25 if not given explicitely.


‘True’ or assumed T/R ratio.
Defaults to 0.95 if not given explicitly.


Intra-subject coefficient(s) of variation as ratio (not percent).

  • If given as a scalar (length(CV)==1) the same CV of Test and Reference is assumed (homoscedasticity, CVwT==CVwR).

  • If given as a vector (length(CV)==2), i.e., assuming heteroscedasticity, the CV of the Test must be given in CV[1] and the one of the Reference in the CV[2].


Number of subjects under study.
May be given as vector. In that case it is assumed that n contains the number of subjects in the sequence groups.
If n is given as single number (total sample size) and this number is not divisible by the number of sequences of the design an unbalanced design is assumed. A corresponding message is thrown showing the numbers of subjects in sequence groups.
Attention! In case of the "2x2x3" (TRT|RTR) design the order of sample sizes is important if given as vector. n[1] is for sequence group 'TRT' and n[2] is for sequence group 'RTR'.


Design of the study to be planned.
"2x2" or "2x2x2" is the conventional cross-over design.
"2x3x3" is the partial replicate design (TRR|RTR|RRT).
"2x2x4" is the full replicate design with 2 sequences and 4 periods.
"2x2x3" is the 3-period design with sequences TRT|RTR.
Defaults to design="2x2".


Alternatively to using the arguments design and n the design may be defined via a data.frame with columns subject, sequence, period and tmt. This feature is experimental in the sense that the data.frame is not checked for complying with the assumed structure.
If you use the argument design_dta you don't need to specify the arguments design and n.
The default design_dta = NULL means that design and n are used for the internal construction of the design data.frame.


Number of (logistical) groups. Defaults to 2.


Vector of number of subjects in groups.


Number describing the model incorporating group effects

  • gmodel=1 is full FDA model for testing group-by-treatment interaction followed by gmodel=2 or gmodel=3 with data of the biggest group depending on the test of the treatment by group interaction

  • gmodel=2 is full FDA model but without group-by-treatment interaction

  • gmodel=3 is model with pooled groups, i.e. without any group term

Defaults to gmodel=2.


Number of simulations to be performed to obtain the empirical power. Defaults to 100,000 = 1e+05.
If simulations are aimed for empirical alpha nsims=1e+06 is recommended.


If set to TRUE the computational time is shown.


Simulations are dependent on the starting point of the (pseudo) random number generator. To avoid differences in power for different runs a set.seed(123456) is issued if setseed=TRUE, the default.


Should a progressbar be shown? Defaults to TRUE if missing and nsims >5E5.


The power is calculated via subject data sims.
The evaluation of BE is done via 1-2*alpha confidence interval using classical ANOVA for the models with group effects.
The data.frame with columns subject, sequence, period and tmt necessary for evalution of simulated subject data is constructed internally from the arguments design and n or may be given user defined via the argument design_dta. The last option is usefull if missing data have to be considered or if designs have to be evaluated which are not in the list of argument design.
This feature is experimental in the sense that the data.frame is not checked for complying with the assumed structure.


Returns the value of the (empirical) power


The run time of the function may be relatively long.
Take a cup of coffee and be patient.


D. Labes


Schütz H.
Multi-Group Studies in Bioequivalence. To pool or not to pool?
Presentation at BioBriges 2018, Prague. https://bebac.at/lectures/Prague2018.pdf


# power for gmodel=2, 2x2 crossover, grps=3 with even number of subjects
power.TOST.sds(CV=0.2, n=18, grps=3)
# gives [1] 0.78404
# without considering groups
power.TOST.sds(CV=0.2, n=18, gmodel=3)
# gives [1] 0.7887

PowerTOST documentation built on Jan. 18, 2021, 5:07 p.m.