View source: R/sampleN_2TOST_sim.R
sampleN.2TOST | R Documentation |
Estimates the necessary sample size to have at least a given power when two parameters are 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,
nsims = 1e+05)
alpha |
Vector; contains one-sided significance level for each of the two TOSTs. |
targetpower |
Power to achieve at least. Must be >0 and <1. |
logscale |
Should the data used on log-transformed or on original scale? |
theta0 |
Vector; contains ‘true’ assumed T/R ratio for each of the two TOSTs. |
theta1 |
Vector; contains lower bioequivalence limit for each of the two TOSTs. |
theta2 |
Vector; contains upper bioequivalence limit for each of the two TOSTs. |
CV |
Vector of coefficient of variations (given as as ratio, e.g., 0.2 for 20%). |
rho |
Correlation between the two PK metrics (e.g., AUC and Cmax) under consideration. This is defined as correlation between the estimator of the treatment difference of PK metric one and the estimator of the treatment difference of PK metric two. Has to be within {–1, +1}. |
design |
Character string describing the study design. |
setseed |
Logical; if |
robust |
Defaults to |
print |
If |
details |
If |
imax |
Maximum number of steps in sample size search. |
nsims |
Number of studies to simulate. Defaults to 100,000 = 1E5. |
The sample size is estimated via iterative evaluation of power of the two TOSTs.
Start value for the sample size search is taken from a large sample approximation
(one TOST) according to Zhang, modified.
The sample size is bound to 4 as minimum.
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 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, use f.i. for-loops or the apply-family.
If both theta0
are near the acceptance limits then the starting value may not
be a good approximation resulting in a lot of iteration steps; imax
may need
to be increased to obtain the required sample size.
B. Lang, D. Labes
Phillips KF. Power for Testing Multiple Instances of the Two One-Sided Tests Procedure. Int J Biostat. 2009;5(1):Article 15.
Hua SY, Xu S, D’Agostino RB Sr. Multiplicity adjustments in testing for bioequivalence. Stat Med. 2015;34(2):215–31. \Sexpr[results=rd]{tools:::Rd_expr_doi("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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.6488")}
Zhang P. A Simple Formula for Sample Size Calculation in Equivalence Studies. J Biopharm Stat. 2003;13(3):529–538. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1081/BIP-120022772")}
power.2TOST, known.designs
# 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.80879
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.80094
sampleN.2TOST(logscale=FALSE, theta0 = rep(-0.05, 2), CV = c(0.2, 0.2),
rho = 0.9, design = "parallel")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.