The package contains functions to obtain the operational characteristics (power, type I error, percentage of studies proceeding to the second stage, average and quantiles of total sample sizes) of bioequivalence studies in adaptive sequential Two-Stage Designs (TSD) via simulations.
Version 0.5.4.9000 built 2022-07-02 with R 4.2.1 (development version not on CRAN).
Since the many letters denoting the methods given by various authors might be confusing, I classified the methods as two ‘types’:
- ‘Type 1’
An adjusted α is used both in the interim as well as in the final analysis of pooled data. - ‘Type 2’
Whether an unadjusted or an adjusted α is used depends on interim power. An adjusted α is used in the final analysis of pooled data.
It should be noted that the adjusted alphas do not necessarily have to be the same in both stages. Below a summary of conditions used in the decision schemes of the published methods.
- Potvin et al. (2008) ‘Method B’: α 0.0294 (θ0 0.95, target power 0.80).
- Fuglsang (2013) ‘Method B’: α 0.0284 (θ0 0.95, target power 0.90).
- Karalis (2013) ‘TSD-2’: α 0.0294 (θ0 = PE, target power 0.80).
- Fuglsang (2014) ‘Method B’ (parallel design): α 0.0294 (θ0 0.95, target power 0.80).
- Zheng et al. (2015) ‘MSDBE’: α1 0.01, α2 0.04.
- Xu et al. (2016) ‘Method E’:
(θ0 0.95, target power 0.80, nmax 42).
- For CV 10–30%
α1 0.0294, α2 0.0357, futility rule on CI {0.9374, 1/0.9374}. - For CV 30–55%
α1 0.0254, α2 0.0363, futility rule on CI {0.9305, 1/0.9305}.
- For CV 10–30%
- Molins et al. (2017) ‘Type 1 modified Potvin B’: α 0.0301 (θ0 0.95, target power 0.80, min. n2 = 1.5n1, nmax 150).
- Potvin et al. (2008) ‘Method C’: α 0.0294 (θ0 0.95, target power 0.80).
- Montague et al. (2011) ‘Method D’: α 0.0280 (θ0 0.90, target power 0.80).
- Fuglsang (2013) ‘Method
C/D’:
α 0.0274 (θ0 0.95, target power 0.90).
α 0.0269 (θ0 0.90, target power 0.90). - Karalis and Macheras (2013) ‘TSD’: α 0.0294 (θ0 = PE, target power 0.80).
- Karalis (2013) ‘TSD-1’: α 0.0280 (θ0 = PE, target power 0.80).
- Xu et al. (2016) ‘Method F’:
(θ0 0.95, target power 0.80, nmax 180).
- For CV 10–30%
α1 0.0248, α2 0.0364, futility rule on CI {0.9492, 1/0.9492}. - For CV 30–55%
α1 0.0259, α2 0.0349, futility rule on CI {0.9350, 1/0.9350}.
- For CV 10–30%
- Molins et al. (2017) ‘Type 2 modified Potvin C’: α 0.0280 (θ0 0.95, target power 0.80, min. n2 = 1.5n1, nmax 150).
Golkowski et al. (2014).
Kieser and Rauch (2015).
König et al. (2014), Kieser and Rauch (2015), Wassmer and Brannath (2016), Maurer et al. (2018).
Defaults employed if not specified in the function call:
function | theta0 |
target power |
usePE |
Nmax |
max.n |
fCrit |
fClower |
---|---|---|---|---|---|---|---|
power.tsd() |
0.95 |
0.80 |
FALSE |
Inf |
– | – | – |
power.tsd.fC() |
0.95 |
0.80 |
FALSE |
– | Inf |
"PE" |
0.80 |
power.tsd.KM() |
0.95 |
0.80 |
– | 150 |
– | – | – |
power.tsd.ssr() |
0.95 |
0.80 |
FALSE |
– | Inf |
– | – |
power.tsd.GS() |
0.95 |
– | – | – | – | "PE" |
0.80 |
power.tsd.in() |
0.95 |
0.80 |
FALSE |
– | Inf |
"CI" |
0.95 |
power.tsd.p() |
0.95 |
0.80 |
FALSE |
Inf |
– | – | – |
All functions are for a 2×2×2 crossover design except power.tsd.p()
,
which is for a two-group parallel design.
If usePE = TRUE
the point estimate in the interim is used in sample
size estimation of the second stage.
If the estimated total sample size exceeds max.n
the second stage will
be forced to max.n - n1
(i.e., it is not a futility criterion).
The method used for interim power and sample size estimation is
specified by the argument pmethod
. It defaults to "nct"
(approximation by the noncentral t-distribution) except in
power.tsd.GS()
, where the total sample size is already fixed.
The BE limits are specified by the arguments theta1
and theta2
(default to 0.80 and 1.25).
The number of simulations is specified by the argument nsims
. It
defaults to 1e5 if simulating power and to 1e6 if simulating the empiric
type I error (i.e., theta0
set to the value of theta1
or
theta2
).
Futility Criteria in the Interim
Nmax
: The study will stop if the estimated total sample size exceedsNmax
.fCrit
("PE"
or"CI"
): The study will stop if outsidefClower
and1/fClower
."PE"
:fClower
defaults to 0.80."CI"
:fClower
defaults to 0.925 (except in functionpower.tsd.in()
, where it defaults to 0.95).
sampleN2.TOST()
Estimates the sample size of stage 2 to achieve at least the target power.interim.tsd.in()
Interim analysis based on the Inverse-Normal Combination method.final.tsd.in()
Final analysis based on the Inverse-Normal Combination method.
Before running the examples attach the library.
library(Power2Stage)
If not noted otherwise, defaults are employed.
Power estimation by the shifted central t-distribution.
power.tsd(CV = 0.20, n1 = 12, pmethod = "shifted")
# TSD with 2x2 crossover
# Method B: alpha (s1/s2) = 0.0294 0.0294
# Target power in power monitoring and sample size est. = 0.8
# Power calculation via shifted central t approx.
# CV1 and GMR = 0.95 in sample size est. used
# No futility criterion
# BE acceptance range = 0.8 ... 1.25
#
# CV = 0.2; n(stage 1) = 12; GMR = 0.95
#
# 1e+05 sims at theta0 = 0.95 (p(BE) = 'power').
# p(BE) = 0.84454
# p(BE) s1 = 0.41333
# Studies in stage 2 = 56.45%
#
# Distribution of n(total)
# - mean (range) = 20.7 (12 ... 82)
# - percentiles
# 5% 50% 95%
# 12 18 40
Explore the empiric type I error at the upper BE-limit.
power.tsd(CV = 0.20, n1 = 12, pmethod = "shifted",
theta0 = 1.25)[["pBE"]]
# [1] 0.046352
Power estimation by the shifted central t-distribution.
power.tsd(method = "C", CV = 0.20, n1 = 12, pmethod = "shifted")
# TSD with 2x2 crossover
# Method C: alpha0 = 0.05, alpha (s1/s2) = 0.0294 0.0294
# Target power in power monitoring and sample size est. = 0.8
# Power calculation via shifted central t approx.
# CV1 and GMR = 0.95 in sample size est. used
# No futility criterion
# BE acceptance range = 0.8 ... 1.25
#
# CV = 0.2; n(stage 1) = 12; GMR = 0.95
#
# 1e+05 sims at theta0 = 0.95 (p(BE) = 'power').
# p(BE) = 0.8496
# p(BE) s1 = 0.42656
# Studies in stage 2 = 53.7%
#
# Distribution of n(total)
# - mean (range) = 20.6 (12 ... 82)
# - percentiles
# 5% 50% 95%
# 12 18 40
Slightly better than ‘Method B’ in terms of power in both stages and fewer studies are expected to proceed to the second stage.
Explore the empiric type I error at the upper BE-limit (1 milion simulations).
power.tsd(method = "C", CV = 0.20, n1 = 12, pmethod = "shifted",
theta0 = 1.25)[["pBE"]]
# [1] 0.051238
Slight inflation of the type I error (although considered negligible by the authors). However, more adjustment (adjusted α 0.0280) controls the type I error.
power.tsd(method = "C", alpha = rep(0.0280, 2), CV = 0.20,
n1 = 12, pmethod = "shifted", theta0 = 1.25)[["pBE"]]
# [1] 0.049903
Data given by Potvin et al. in Example 2: 12 subjects in stage 1, PE 1.0876, CV 0.18213, all defaults of the function used.
interim.tsd.in(GMR = 0.95, GMR1 = 1.0876, CV1 = 0.18213, n1 = 12)
# TSD with 2x2 crossover
# Inverse Normal approach
# - Maximum combination test with weights for stage 1 = 0.5 0.25
# - Significance levels (s1/s2) = 0.02635 0.02635
# - Critical values (s1/s2) = 1.93741 1.93741
# - BE acceptance range = 0.8 ... 1.25
# - Observed point estimate from stage 1 is not used for SSR
# - With conditional error rates and conditional estimated target power
#
# Interim analysis after first stage
# - Derived key statistics:
# z1 = 3.10000, z2 = 1.70344
# Repeated CI = (0.92491, 1.27891)
# Median unbiased estimate = NA
# - No futility criterion met
# - Test for BE not positive (not considering any futility rule)
# - Calculated n2 = 6
# - Decision: Continue to stage 2 with 6 subjects
The second stage should be initiated with 6 subjects. Note that with
interim.tsd.in(..., fCrit = "No", ssr.conditional = "no")
8 subjects
would be required like in the Methods of Potvin et al.
The second stage is performed in 8 subjects, PE 0.9141, CV 0.25618.
final.tsd.in(GMR1 = 1.0876, CV1 = 0.18213, n1 = 12,
GMR2 = 0.9141, CV2 = 0.25618, n2 = 8)
# TSD with 2x2 crossover
# Inverse Normal approach
# - Maximum combination test with weights for stage 1 = 0.5 0.25
# - Significance levels (s1/s2) = 0.02635 0.02635
# - Critical values (s1/s2) = 1.93741 1.93741
# - BE acceptance range = 0.8 ... 1.25
#
# Final analysis after second stage
# - Derived key statistics:
# z1 = 2.87952, z2 = 2.60501
# Repeated CI = (0.87690, 1.17356)
# Median unbiased estimate = 1.0135
# - Decision: BE achieved
The study passed with a (repeated) CI of 87.69–117.36%. Although slightly more conservative, same conclusion like based on the 94.12% CI of 88.45–116.38% reported by Potvin et al.
Performed on a Xeon E3-1245v3 3.4 GHz, 8 MB cache, 16 GB RAM, R 4.2.1 on Windows 7.
‘Method B’ (CV 0.20, n1 12).
# method power seconds
# shifted 0.84454 1.09
# nct 0.84266 1.61
# exact 0.84260 31.98
Despite being the fastest, the shifted central t-distribution should only be used in order to compare with published methods. The noncentral t-distribution is a good compromise between speed and accuracy and hence, the default in all functions. The exact method based on Owen’s Q-function is time-consuming and therefore, not recommended in validating a custom method in a narrow grid of n1/CV-combinations. However, in designing a new study it is the method of choice.
Blinded sample size re-estimation (α 0.03505, CV 0.239, n1 10, target power 0.90), 1 million simulations for the empiric type I error.
# method TIE seconds
# ls 0.049054 3.67
# shifted 0.046106 12.85
# nct 0.046319 18.24
# exact 0.046319 429.10
The crude large sample approximation (pmethod = "ls"
) should only be
used to compare with the published method.
You can install the released version of Power2Stage from CRAN with …
package <- "Power2Stage"
inst <- package %in% installed.packages()
if (length(package[!inst]) > 0) install.packages(package[!inst])
… and the development version from GitHub with
# install.packages("devtools")
devtools::install_github("Detlew/Power2Stage")
Skips installation from a github remote if the
SHA-1 has not changed since last
install. Use force = TRUE
to force installation.
Inspect this information for reproducibility. Of particular importance
are the versions of R and the packages used to create this workflow. It
is considered good practice to record this information with every
analysis.
Version 0.5.4.9000 built 2022-07-02 with R 4.2.1.
options(width = 66)
sessionInfo()
# R version 4.2.1 (2022-06-23 ucrt)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 10 x64 (build 22000)
#
# Matrix products: default
#
# locale:
# [1] LC_COLLATE=German_Austria.utf8
# [2] LC_CTYPE=German_Austria.utf8
# [3] LC_MONETARY=German_Austria.utf8
# [4] LC_NUMERIC=C
# [5] LC_TIME=German_Austria.utf8
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods
# [7] base
#
# other attached packages:
# [1] Power2Stage_0.5-4.9000
#
# loaded via a namespace (and not attached):
# [1] Rcpp_1.0.8.3 mvtnorm_1.1-3 digest_0.6.29
# [4] PowerTOST_1.5-4 magrittr_2.0.3 evaluate_0.15
# [7] TeachingDemos_2.12 rlang_1.0.3 stringi_1.7.6
# [10] cli_3.3.0 cubature_2.0.4.4 rstudioapi_0.13
# [13] rmarkdown_2.14 tools_4.2.1 stringr_1.4.0
# [16] xfun_0.31 yaml_2.3.5 fastmap_1.1.0
# [19] compiler_4.2.1 htmltools_0.5.2 knitr_1.39