
Last chance! 50% off unlimited learning
Sale ends in
Calculates the necessary sample size to have at least a given power when two parameters are being tested simultaneously.
sampleN.2TOST(alpha = c(0.05, 0.05), targetpower = 0.8, logscale = TRUE,
theta0, theta1, theta2, CV, rho, design = "2x2", setseed = TRUE,
robust = FALSE, print = TRUE, details = FALSE, imax = 100)
Vector; contains one-sided significance level for each of the two TOSTs. For one TOST, by convention mostly set to 0.05.
Power to achieve at least. Must be >0 and <1. Typical values are 0.8 or 0.9.
Should the data used on log-transformed or on original scale? TRUE or FALSE. Defaults to TRUE.
Vector; contains 'true' assumed bioequivalence ratio for each of the two TOSTs.
In case of logscale=TRUE
each element must be given as ratio,
otherwise as difference to 1. See examples.
Defaults to c(0.95, 0.95)
if logscale=TRUE
or to
c(0.05, 0.05)
if logscale=FALSE
.
Vector; contains lower bioequivalence limit for each of the two TOSTs.
In case of logscale=TRUE
it is given as ratio, otherwise as diff. to 1.
Defaults to c(0.8, 0.8)
if logscale=TRUE
or to c(-0.2, -0.2)
if logscale=FALSE
.
Vector; contains upper bioequivalence limit for each of the two TOSTS.
If not given theta2 will be calculated as 1/theta1
if logscale=TRUE
or as -theta1
if logscale=FALSE
.
Vector of coefficient of variations (given as as ratio, e.g. 0.2 for 20%).
In case of cross-over studies this is the within-subject CV,
in case of a parallel-group design the CV of the total variability.
In case of logscale=FALSE
CV is assumed to be the respective standard
deviation.
Correlation between the two parameters under consideration. This is defined as correlation between the estimator of the treatment difference of parameter one and the estimator of the treatment difference of parameter two.
Character string describing the study design.
See known.designs()
for designs covered in this package.
Calculation depends on pmvt()
which is based on randomized quasi Monte Carlo
methods. If setseed=TRUE
a seed value is set, the default.
Defaults to FALSE
. With that value the usual degrees of freedom will be used.
Set to TRUE
will use the degrees of freedom according to the 'robust' evaluation
(aka Senn's basic estimator). These df are calculated as n-seq
.
See known.designs()$df2
for designs covered in this package.
Has only effect for higher-order crossover designs.
If TRUE
(default) the function prints its results.
If FALSE
only the result list will be returned.
If TRUE
the design characteristics and the steps during
sample size calculations will be shown.
Defaults to FALSE
.
Maximum number of steps in sample size search. Defaults to 100.
A list with the input and results will be returned. The element name "Sample size" contains the total sample size.
The function does not vectorize properly. If you need sample sizes with varying CVs f.i. use for-loops or the apply-family.
The sample size is calculated via iterative evaluation of power of the 2 TOSTs. Start value for the sample size search is taken from a large sample approximation (1 TOST) according to Zhang, modified. The sample size is bound to 4 as minimum.
Hua SY, Xu S, D'Agostino RB Sr. Multiplicity adjustments in testing for bioequivalence Stat Med. 2015;34(2):215--31. 10.1002/sim.6247
Lang B, Fleischer F. Letter to the Editor: Comments on 'Multiplicity adjustments in testing for bioequivalence' Stat Med. 2016;35(14):2479--80. 10.1002/sim.6488
Zhang P. A Simple Formula for Sample Size Calculation in Equivalence Studies J Biopharm Stat. 2003;13(3):529--538. 10.1081/BIP-120022772
# NOT RUN {
# Sample size for 2x2x2 cross-over design, intra-subject CV = 30% and assumed
# ratios of 0.95 for both parameters, and correlation 0.9 between parameters
# (using all the other default values)
# Should give n=44 with power=0.808840
sampleN.2TOST(theta0 = rep(0.95, 2), CV = rep(0.3, 2), rho = 0.9)
# Sample size for a parallel group design,
# evaluation on the original (untransformed) scale
# BE limits 80 ... 120% = -20% ... +20% of reference,
# assumed true BE ratio 0.95% = -5% to reference mean for both parameters,
# total CV=20% for both parameters, and correlation 0.9 between parameters
# should give n=52 with power=0.801250
sampleN.2TOST(logscale=FALSE, theta0 = rep(-0.05, 2), CV = c(0.2, 0.2),
rho = 0.9, design = "parallel")
# }
Run the code above in your browser using DataLab