Title: | Power and Sample-Size Distribution of 2-Stage Bioequivalence Studies |
---|---|
Description: | Contains functions to obtain the operational characteristics of bioequivalence studies in Two-Stage Designs (TSD) via simulations. |
Authors: | Detlew Labes [aut, cre] |
Maintainer: | Detlew Labes <[email protected]> |
License: | GPL (>=2) |
Version: | 0.5-4.9000 |
Built: | 2025-01-29 02:36:23 UTC |
Source: | https://github.com/detlew/power2stage |
Following the design scheme according to power.tsd.in
the function
performs the analysis after the second stage has been performed.
final.tsd.in(alpha, weight, max.comb.test = TRUE, GMR1, CV1, n1, df1 = NULL, SEM1 = NULL, GMR2, CV2, n2, df2 = NULL, SEM2 = NULL, theta1, theta2)
final.tsd.in(alpha, weight, max.comb.test = TRUE, GMR1, CV1, n1, df1 = NULL, SEM1 = NULL, GMR2, CV2, n2, df2 = NULL, SEM2 = NULL, theta1, theta2)
alpha |
If one element is given, the overall one-sided significance level (not the
adjusted level for stage 2). If two
elements are given, the adjusted one-sided alpha levels for
stage 1 and
stage 2, respectively. |
weight |
Pre-defined weight(s) of stage 1.
Note that using the notation from Maurer et al weight corresponds to
information fraction, other literature may refer to sqrt(weight) as
being the weight. |
max.comb.test |
Logical; if |
GMR1 |
Observed ratio of geometric means (T/R) of stage 1 data (use e.g., 0.95 for 95%). |
CV1 |
Observed coefficient of variation of the intra-subject variability of stage 1 (use e.g., 0.3 for 30%). |
n1 |
Sample size of stage 1. |
df1 |
Optional; Error degrees of freedom of
stage 1 that can be specified in
addition to |
SEM1 |
Optional; Standard error of the difference of means of
stage 1 that can be specified in
addition to |
GMR2 |
Observed ratio of geometric means (T/R) of (only) stage 2 data (use e.g., 0.95 for 95%). |
CV2 |
Observed coefficient of variation of the intra-subject variability of (only) stage 2 (use e.g., 0.3 for 30%). |
n2 |
Sample size of stage 2. |
df2 |
Optional; Error degrees of freedom of (only)
stage 2 that can be specified in
addition to |
SEM2 |
Optional; Standard error of the difference of means of (only)
stage 2 that can be specified in
addition to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
The observed values GMR1
, CV1
, n1
must be obtained
using data from stage 1 only, and GMR2
, CV2
, n2
must
be obtained using data from stage 2 only. This may be done via the usual
ANOVA approach.
The optional arguments df1
, SEM1
, df2
and SEM2
require a somewhat advanced knowledge (provided in the raw output from for
example the software SAS, or may be obtained via emmeans::emmeans
).
However, it has the advantage that if there were missing data the exact
degrees of freedom and standard error of the difference can be used,
the former possibly being non-integer valued (e.g. if the
Kenward-Roger method was used).
Returns an object of class "evaltsd"
with all the input arguments and results
as components. As part of the input arguments a component cval
is also
presented, containing the critical values for stage 1 and 2 according to the
input based on alpha
, weight
and max.comb.test
.
The class "evaltsd"
has an S3 print method.
The results are in the components:
z1 |
Combination test statistic for first null hypothesis (standard
combination test statistic in case of |
z2 |
Combination test statistic for second null hypothesis (standard
combination test statistic in case of |
RCI |
Repeated confidence interval for stage 2. |
MEUE |
Median unbiased point estimate as estimate for the final adjusted geometric mean ratio after stage 2. |
stop_BE |
Logical, indicating whether BE can be concluded after stage 2 or not. |
B. Lang
König F, Wolfsegger M, Jaki T, Schütz H, Wassmer G.
Adaptive two-stage bioequivalence trials with early stopping and sample size re-estimation.
Vienna: 2014; 35th Annual Conference of the International Society for Clinical Biostatistics. Poster P1.2.88
doi:10.13140/RG.2.1.5190.0967.
Patterson SD, Jones B. Bioequivalence and Statistics in Clinical Pharmacology.
Boca Raton: CRC Press; 2nd edition 2017.
Maurer W, Jones B, Chen Y. Controlling the type 1 error rate in two-stage
sequential designs when testing for average bioequivalence.
Stat Med. 2018; 37(10): 1587–1607. doi:10.1002/sim.7614.
Wassmer G, Brannath W. Group Sequential and Confirmatory Adaptive Designs
in Clinical Trials.
Springer 2016. doi:10.1007/978-3-319-32562-0.
# Example from Maurer et al. final.tsd.in(GMR1 = exp(0.0424), CV1 = 0.3682, n1 = 20, GMR2 = exp(-0.0134), CV2 = 0.3644, n2 = 36) # Example 2 from Potvin et al. final.tsd.in(GMR1 = 1.0876, CV1 = 0.18213, n1 = 12, GMR2 = 0.9141, CV2 = 0.25618, n2 = 8)
# Example from Maurer et al. final.tsd.in(GMR1 = exp(0.0424), CV1 = 0.3682, n1 = 20, GMR2 = exp(-0.0134), CV2 = 0.3644, n2 = 36) # Example 2 from Potvin et al. final.tsd.in(GMR1 = 1.0876, CV1 = 0.18213, n1 = 12, GMR2 = 0.9141, CV2 = 0.25618, n2 = 8)
Following the design scheme according to power.tsd.in
the function
performs the interim analysis of the first stage data.
interim.tsd.in(alpha, weight, max.comb.test = TRUE, targetpower = 0.8, GMR1, n1, CV1, df1 = NULL, SEM1 = NULL, theta1, theta2, GMR, usePE = FALSE, min.n2 = 4, max.n = Inf, fCpower = targetpower, fCrit = "CI", fClower, fCupper, fCNmax, ssr.conditional = c("error_power", "error", "no"), pmethod = c("exact", "nct", "shifted"))
interim.tsd.in(alpha, weight, max.comb.test = TRUE, targetpower = 0.8, GMR1, n1, CV1, df1 = NULL, SEM1 = NULL, theta1, theta2, GMR, usePE = FALSE, min.n2 = 4, max.n = Inf, fCpower = targetpower, fCrit = "CI", fClower, fCupper, fCNmax, ssr.conditional = c("error_power", "error", "no"), pmethod = c("exact", "nct", "shifted"))
alpha |
If one element is given, the overall one-sided significance level (not
the adjusted level for stage 1). In this
case the adjusted alpha levels will be calcualted internally. If two
elements are given, the argument refers to the two adjusted one-sided
alpha levels for stage 1 and
stage 2, respectively. |
weight |
Pre-defined weight(s) of stage 1, see
'Details' for more information. Note that using the notation from
Maurer et al, weight corresponds to information fraction, other literature
may refer to sqrt(weight) as being the weight. |
max.comb.test |
Logical; if |
targetpower |
Desired (overall) target power to declare BE at the end of the trial. |
GMR1 |
Observed ratio of geometric means (T/R) of stage 1 data (use e.g., 0.95 for 95%). |
n1 |
Sample size of stage 1. |
CV1 |
Observed coefficient of variation of the intra-subject variability of stage 1 (use e.g., 0.3 for 30%). |
df1 |
Optional; Error degrees of freedom of
stage 1 that can be specified in
addition to |
SEM1 |
Optional; Standard error of the difference of means of
stage 1 that can be specified in
addition to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
GMR |
Assumed ratio of geometric means (T/R) to be used in power calculation for stage 1 and sample size re-estimation for stage 2. |
usePE |
If |
min.n2 |
Minimum sample size of stage 2. Defaults to 4. |
max.n |
Maximum overall sample size stage 1 +
stage 2. |
fCpower |
Threshold for power monitoring step to decide on futility for cases where
BE has not been achieved after
stage 1: If BE has not been
achieved after stage 1 and the power for
stage 1 is greater than or equal to
|
fCrit |
Futility criterion to use: |
fClower |
Lower futility limit for the PE or CI of
stage 1. |
fCupper |
Upper futility limit for the PE or CI of
stage 1. |
fCNmax |
Futility criterion regarding maximum sample size. If the determined sample size
for stage 2 ( |
ssr.conditional |
Method for sample size re-estimation step: |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
The observed values of stage 1 (e.g. GMR1
, n1
, CV1
) may
be obtained based on the first stage data via the usual ANOVA approach.
The optional arguments df1
and SEM1
require a somewhat
advanced knowledge (provided in the raw output from for example the software
SAS, or may be obtained via emmeans::emmeans
).
However, it has the advantage that if there were missing data the exact
degrees of freedom and standard error of the difference can be used,
the former possibly being non-integer valued (e.g. if the
Kenward-Roger method was used).
The weight
argument always refers to the first weight of a pair of
weights. For example, in case of max.comb.test = FALSE
the standard
combination test requires two weights (w, 1-w) but only the first one, w,
is required as input argument here because the second weight is
automatically specified once the first is given. Similarly for
max.comb.test = TRUE
, w and w* need to be specified, which in turn
define the two pairs of weights (w, 1-w) and (w*, 1-w*).
If ssr.conditional = "error_power"
, the design scheme generally
calculates the estimated conditional target power of the second stage and
uses this value as desired target power in the sample size re-estimation process:
If fCpower
> targetpower
, then the conditional estimated
target power may be negative. This does not seem sensible. Therefore, for such
cases the desired target power for the sample size re-calculation will be set
to targetpower
, i.e. ssr.conditional
will be set to "error"
.
Also, if the futility criterion based on the power of stage 1 is met,
then the conditional estimated target power will be negative. Thus, no further
sample size calculation can be made. To acknowledge that this rule is nonbinding,
for the purpose of calculating n2 the argument ssr.conditional
is set
to "error"
.
Returns an object of class "evaltsd"
with all the input arguments and results
as components. As part of the input arguments a component cval
is also
presented, containing the critical values for
stage 1 and 2 according to the
input based on alpha
, weight
and max.comb.test
.
The class "evaltsd"
has an S3 print method.
The results are in the components:
p11 |
Observed p-value for first hypothesis. |
p12 |
Observed p-value for second hypothesis. |
z1 |
z statistic value for first null hypothesis. |
z2 |
z statistic value for second null hypothesis. |
RCI |
Repeated confidence interval for stage 1. Corresponds to the usual CI with level alpha1. |
MEUE |
If the study stops, the median unbiased point estimate as estimate for the final adjusted
geometric mean ratio after stage 1 (note that the value is identical to |
futility |
Three dimensional vector with either 0 or 1. The first
component represents futility due to Power of first stage > |
CI90 |
90% Confidence interval for observed ratio of geometric means
from stage 1. If |
Power Stage 1 |
Calculated power of stage 1. |
stop_s1 |
Logical, indicating whether to stop after stage 1 (due to BE or due to futility). |
stop_fut |
Logical, indicating whether study is recommended to be stopped after stage 1 due to futility. |
stop_BE |
Logical, indicating whether BE could be concluded after stage 1 or not (regardless of any futility criterion). |
n2 |
Required (total) sample size for stage 2 (will be zero if BE has been shown after stage 1). |
alpha_ssr |
Only applicable if BE has not been shown after
stage 1. Contains
alpha values for the two hypotheses required for sample size re-calculation.
If |
GMR_ssr |
Only applicable if BE has not been shown after stage 1. Contains the geometric mean ratio used for sample size re-calculation (accounts for adaptive planning step). |
targetpower_ssr |
Only applicable if BE has not been shown after stage 1. Contains the target power used for the sample size re-calculation (see also 'Details'). |
B. Lang
König F, Wolfsegger M, Jaki T, Schütz H, Wassmer G.
Adaptive two-stage bioequivalence trials with early stopping and sample size re-estimation.
Vienna: 2014; 35th Annual Conference of the International Society for Clinical Biostatistics. Poster P1.2.88
doi:10.13140/RG.2.1.5190.0967.
Patterson SD, Jones B. Bioequivalence and Statistics in Clinical Pharmacology.
Boca Raton: CRC Press; 2nd edition 2017.
Maurer W, Jones B, Chen Y. Controlling the type 1 error rate in two-stage
sequential designs when testing for average bioequivalence.
Stat Med. 2018; 37(10): 1587–1607. doi:10.1002/sim.7614.
Wassmer G, Brannath W. Group Sequential and Confirmatory Adaptive Designs
in Clinical Trials.
Springer 2016. doi:10.1007/978-3-319-32562-0.
# Example from Maurer et al. interim.tsd.in(GMR = 0.95, max.n = 4000, GMR1 = exp(0.0424), CV1 = 0.3682, n1 = 20) # Example 2 from Potvin et al. interim.tsd.in(GMR = 0.95, GMR1 = 1.0876, CV1 = 0.18213, n1 = 12, fCrit = "No", ssr.conditional = "no")
# Example from Maurer et al. interim.tsd.in(GMR = 0.95, max.n = 4000, GMR1 = exp(0.0424), CV1 = 0.3682, n1 = 20) # Example 2 from Potvin et al. interim.tsd.in(GMR = 0.95, GMR1 = 1.0876, CV1 = 0.18213, n1 = 12, fCrit = "No", ssr.conditional = "no")
This function calculates the ‘empiric’ power of 2-stage BE studies according to Potvin et al. via simulations. The Potvin methods are modified to include a futility criterion Nmax and to allow the sample size estimation step to be done with the point estimate (PE) and MSE (calculated from CV) of stage 1.
power.tsd(method = c("B", "C", "B0"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, Nmax = Inf, min.n2 = 0, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd(method = c("B", "C", "B0"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, Nmax = Inf, min.n2 = 0, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
method |
Decision schemes according to Potvin et.al. (defaults to |
alpha0 |
Alpha value for the first step(s) in Potvin |
alpha |
Vector (two elements) of the nominal alphas for the two stages. Defaults to
Pocock’s setting |
n1 |
Sample size of stage 1. |
GMR |
Ratio T/R to be used in decision scheme (power calculations in stage 1 and sample size estimation for stage 2). |
CV |
Coefficient of variation of the intra-subject variability (use e.g., 0.3 for 30%). |
targetpower |
Power threshold in the power monitoring steps and power to achieve in the sample size estimation step. |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
usePE |
If |
Nmax |
Futility criterion. If set to a finite value, all studies simulated in which a
sample size |
min.n2 |
Minimum sample size of stage 2. Defaults to zero. |
theta0 |
True ratio of T/R for simulating. Defaults to the |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described in Potvin
et al.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, SS2 are
simulated via their associated distributions (normal and
χ2 distributions).
Returns an object of class "pwrtsd"
with all the input arguments and results
as components.
The class "pwrtsd"
" has an S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total), aka average total sample size (ASN). |
nrange |
Range (min, max) of n(total). |
nperc |
Vector of percentiles of the distribution of n(total). |
ntable |
Object of class |
D. Labes
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA. Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
Montague TH, Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ. Additional results for ‘Sequential design approaches for bioequivalence studies with crossover designs’.
Pharm Stat. 2011; 11(1):8–13. doi:10.1002/pst.483
Fuglsang A. Controlling type I errors for two-stage bioequivalence study designs.
Clin Res Reg Aff. 2011; 28(4):100–5. doi:10.3109/10601333.2011.631547
Fuglsang A. Sequential Bioequivalence Trial Designs with Increased Power and
Controlled Type I Error Rates.
AAPS J. 2013; 15(3):659–61. doi:10.1208/s12248-013-9475-5
Fuglsang A. Futility Rules in Bioequivalence Trials with Sequential Designs.
AAPS J. 2014; 16(1):79–82. doi:10.1208/s12248-013-9540-0
Schütz H. Two-stage designs in bioequivalence trials.
Eur J Clin Pharmacol. 2015; 71(3):271–81. doi:10.1007/s00228-015-1806-2
Kieser M, Rauch G. Two-stage designs for cross-over bioequivalence trials.
Stat Med. 2015; 34(16):2403–16. doi:10.1002/sim.6487
Zheng Ch, Zhao L, Wang J. Modifications of sequential designs in bioequivalence trials.
Pharm Stat. 2015; 14(3):180–8. doi:10.1002/pst.1672
power.tsd.p
for analogous calculations for 2-group parallel
design.power.tsd.fC
for analogous calculations with futility check
based on point estimate of stage 1.
# using all the defaults and 24 subjects in stage 1, CV of 25% power.tsd(n1=24, CV=0.25) # computation time ~ 1 sec # # as above, but save results for further use res <- power.tsd(n1=24, CV=0.25) ## Not run: # representation of the discrete distribution of n(total) # via plot method of object with class "table" which creates a # 'needle' plot plot(res$ntable/sum(res$ntable), ylab="Density", xlab=expression("n"[total]), las=1, main=expression("Distribution of n"[total])) # # If you prefer a histogram instead (IMHO, not the preferred plot): # reconstruct the ntotal values from the ntable ntot <- rep.int(as.integer(names(res$ntable)), times=as.integer(res$ntable)) # annotated histogram hist(ntot, freq=FALSE, breaks=res$nrange[2]-res$nrange[1], xlab=expression("n"[total]), las=1, main=expression("Histogram of n"[total])) abline(v=c(res$nmean, res$nperc[["50%"]]), lty=c(1, 3)) legend("topright", box.lty=0, legend=c("mean", "median"), lty=c(1, 3), cex=0.9) ## End(Not run)
# using all the defaults and 24 subjects in stage 1, CV of 25% power.tsd(n1=24, CV=0.25) # computation time ~ 1 sec # # as above, but save results for further use res <- power.tsd(n1=24, CV=0.25) ## Not run: # representation of the discrete distribution of n(total) # via plot method of object with class "table" which creates a # 'needle' plot plot(res$ntable/sum(res$ntable), ylab="Density", xlab=expression("n"[total]), las=1, main=expression("Distribution of n"[total])) # # If you prefer a histogram instead (IMHO, not the preferred plot): # reconstruct the ntotal values from the ntable ntot <- rep.int(as.integer(names(res$ntable)), times=as.integer(res$ntable)) # annotated histogram hist(ntot, freq=FALSE, breaks=res$nrange[2]-res$nrange[1], xlab=expression("n"[total]), las=1, main=expression("Histogram of n"[total])) abline(v=c(res$nmean, res$nperc[["50%"]]), lty=c(1, 3)) legend("topright", box.lty=0, legend=c("mean", "median"), lty=c(1, 3), cex=0.9) ## End(Not run)
This function calculates the ‘empiric’ power of 2-stage BE studies according to Potvin et al. ‘method B/C’ via simulations. The Potvin methods are modified to include a futility criterion for the point estimate or for its 90%CI and to allow the sample size estimation step to be done with the point estimate (PE) and MSE of stage 1.
power.tsd.fC(method = c("B", "C", "B0"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, CV, GMR, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, powerstep = TRUE, min.n2=0, max.n=Inf, fCrit=c("CI", "PE"), fClower, fCupper, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd.fC(method = c("B", "C", "B0"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, CV, GMR, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, powerstep = TRUE, min.n2=0, max.n=Inf, fCrit=c("CI", "PE"), fClower, fCupper, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
method |
Decision schemes according to Potvin et.al. (defaults to |
alpha0 |
Alpha value for the first step(s) in Potvin |
alpha |
Vector (two elements) of the nominal alphas for the two stages. Defaults to
Pocock’s setting |
n1 |
Sample size of stage 1. For Xu’s methods the recommended sample size should be at least 18 (if CV 10–30%) or 48 (if CV 30–55%). |
CV |
Coefficient of variation of the intra-subject variability (use e.g., 0.3 for 30%). |
GMR |
Ratio T/R to be used in decision scheme (power calculations in stage 1 and sample size estimation for stage 2). |
targetpower |
Power threshold in the power monitoring steps and power to achieve in the sample size estimation step. |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
usePE |
If |
powerstep |
If |
min.n2 |
Minimum sample size of stage 2. Defaults to zero. |
max.n |
If |
fCrit |
Futility criterion. |
fClower |
Lower futility limit for the |
fCupper |
Upper futility limit for the |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing,
defaults to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described in Potvin
et al.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, SS2 are
simulated via their associated distributions (normal and
χ2 distributions).
Returns an object of class "pwrtsd"
with all the input arguments and results
as components.
The class "pwrtsd"
has an S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total), aka average total sample size (ASN). |
nrange |
Range (min, max) of n(total). |
nperc |
Percentiles of the distribution of n(total). |
ntable |
Object of class |
D. Labes
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA. Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
Montague TH, Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ. Additional results for ‘Sequential design approaches for bioequivalence studies with crossover designs’.
Pharm Stat. 2011; 11(1):8–13. doi:10.1002/pst.483
Fuglsang A. Sequential Bioequivalence Trial Designs with Increased Power and
Controlled Type I Error Rates.
AAPS J. 2013; 15(3):659–61. doi:10.1208/s12248-013-9475-5
Schütz H. Two-stage designs in bioequivalence trials.
Eur J Clin Pharmacol. 2015; 71(3):271–81. doi:10.1007/s00228-015-1806-2
Kieser M, Rauch G. Two-stage designs for cross-over bioequivalence trials.
Stat Med. 2015; 34(16):2403–16. doi:10.1002/sim.6487
Zheng Ch, Zhao L, Wang J. Modifications of sequential designs in bioequivalence trials.
Pharm Stat. 2015; 14(3):180–8. doi:10.1002/pst.1672
Xu J, Audet C, DiLiberti CE, Hauck WW, Montague TH, Parr TH, Potvin D, Schuirmann DJ.
Optimal adaptive sequential designs for crossover bioequivalence studies.
Pharm Stat. 2016;15(1):15–27. doi:10.1002/pst.1721
# using all the defaults power.tsd.fC(CV=0.25, n1=24) # run-time ~1 sec ## Not run: # as above but storing the results res <- power.tsd.fC(CV=0.25, n1=24) # representation of the discrete distribution of n(total) # via plot method of object with class "table" which creates a # 'needle' plot plot(res$ntable/sum(res$ntable), ylab="Density", xlab=expression("n"[total]), las=1, main=expression("Distribution of n"[total])) ## End(Not run)
# using all the defaults power.tsd.fC(CV=0.25, n1=24) # run-time ~1 sec ## Not run: # as above but storing the results res <- power.tsd.fC(CV=0.25, n1=24) # representation of the discrete distribution of n(total) # via plot method of object with class "table" which creates a # 'needle' plot plot(res$ntable/sum(res$ntable), ylab="Density", xlab=expression("n"[total]), las=1, main=expression("Distribution of n"[total])) ## End(Not run)
This function calculates the ‘empiric’ power of group sequential
2-stage BE in 2×2 crossover designs via simulations.
The number of subjects in both stages has to be prespecified (non-adaptive).
power.tsd.GS(alpha = c(0.0294, 0.0294), n, CV, theta0, theta1, theta2, fCrit = c("CI", "PE"), fClower, fCupper, nsims, setseed = TRUE, details = FALSE)
power.tsd.GS(alpha = c(0.0294, 0.0294), n, CV, theta0, theta1, theta2, fCrit = c("CI", "PE"), fClower, fCupper, nsims, setseed = TRUE, details = FALSE)
alpha |
Vector of the two nominal alpha values to be used in the
100(1–2α)
confidence interval calculations in the two stages. |
n |
Vector of the two sample sizes in stage 1
and stage 2. |
CV |
Coefficient of variation of the intra-subject variability (use e.g., 0.3 for 30%). |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing, defaults to 0.95. |
theta1 |
Lower bioequivalence limit. Defaults to 0.80. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
fCrit |
Futility criterion. |
fClower |
Lower limit of the futility criterion. Defaults to |
fCupper |
Upper limit of the futility criterion. Defaults to |
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described in Potvin
et al. for adaptive designs, but with no interim power inspection and
pre-specified (fixed) number of subjects in stage 2.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, SS2 are
simulated via their associated distributions (normal and
χ2 distributions).
Returns an object of class "pwrtsd"
with all the input arguments and results
as components.
The class "pwrtsd"
has a S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_s2 |
Percentage of studies continuing to stage 2. |
The code is reasonable fast. 1E6 sims take ~ 1 sec on my machine.
Even 1E7 sims are meanwhile possible without too much beer. :-)
D. Labes
Gould AL. Group sequential extensions of a standard bioequivalence testing procedure.
J Pharmacokin Biopharm. 1995; 23(1):57–86 doi:10.1007/BF02353786
Patterson SD, Jones B. Bioequivalence and Statistics in Clinical Pharmacology.
Boca Raton: CRC Press; 2nd edition 2016. Chapter 5.6 Optional Designs.
Schütz H. Two-stage designs in bioequivalence trials.
Eur J Clin Pharmacol. 2015; 71(3):271–81. doi:10.1007/s00228-015-1806-2
Kieser M, Rauch G. Two-stage designs for cross-over bioequivalence trials.
Stat Med. 2015; 34(16):2403–16. doi:10.1002/sim.6487
Zheng Ch, Zhao L, Wang J. Modifications of sequential designs in bioequivalence trials.
Pharm Stat. 2015; 14(3):180–8. doi:10.1002/pst.1672
power.tsd
and power.tsd.p
for adaptive sequential designs.
# using the Pocock alpha settings and no futility rule # (defaults), a CV of 20% and 12 subjects in both stages, # midway interim power.tsd.GS(CV=0.2, n=c(12,12))
# using the Pocock alpha settings and no futility rule # (defaults), a CV of 20% and 12 subjects in both stages, # midway interim power.tsd.GS(CV=0.2, n=c(12,12))
The function calculates the ‘empirical’ power of 2-stage BE studies based on the Inverse-Normal combination method. The main design scheme is according to Maurer et al. (Maximum Combination Test), but it may also be used for other/modified designs, e.g. standard combination method, usage of the observed treatment difference after stage 1 in the sample size re-estimation step or different futility criteria.
power.tsd.in(alpha, weight, max.comb.test = TRUE, n1, CV, targetpower = 0.8, theta0, theta1, theta2, GMR, usePE = FALSE, min.n2 = 4, max.n = Inf, fCpower = targetpower, fCrit = "CI", fClower, fCupper, fCNmax, ssr.conditional = c("error_power", "error", "no"), pmethod = c("nct", "exact", "shifted"), npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd.in(alpha, weight, max.comb.test = TRUE, n1, CV, targetpower = 0.8, theta0, theta1, theta2, GMR, usePE = FALSE, min.n2 = 4, max.n = Inf, fCpower = targetpower, fCrit = "CI", fClower, fCupper, fCNmax, ssr.conditional = c("error_power", "error", "no"), pmethod = c("nct", "exact", "shifted"), npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
alpha |
If one element is given, the overall one-sided significance level. In this
case the adjusted alpha levels will be calculated internally. If two
elements are given, the argument refers to the two adjusted one-sided alpha
levels for stage 1 and
stage 2, respectively. |
weight |
Pre-defined weight(s) of stage 1, see
'Details' for more information.
Note that using the notation from Maurer et al, weight corresponds to
information fraction, other literature may refer to sqrt(weight) as being
the weight. |
max.comb.test |
Logical; if |
n1 |
Sample size of stage 1. |
CV |
Coefficient of variation of the intra-subject variability (use e.g., 0.3 for 30%). |
targetpower |
Desired (overall) target power to declare BE at the end of the trial. |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing,
defaults to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
GMR |
Assumed ratio of geometric means (T/R) to be used in power calculation for stage 1 and sample size re-estimation for stage 2. If missing, defaults to 0.95. |
usePE |
If |
min.n2 |
Minimum sample size of stage 2. Defaults to 4. |
max.n |
Maximum overall sample size stage 1 +
stage 2. |
fCpower |
Threshold for power monitoring step to decide on futility for cases where
BE has not been achieved after
stage 1: If BE has not been
achieved after stage 1 and the power for
stage 1 is greater than or equal to
|
fCrit |
Futility criterion to use: |
fClower |
Lower futility limit for the PE or CI of
stage 1. |
fCupper |
Upper futility limit for the PE or CI of
stage 1. |
fCNmax |
Futility criterion regarding maximum sample size. If the determined sample size
for stage 2 ( |
ssr.conditional |
Method for sample size re-estimation step: |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, mse2
are simulated via their associated distributions (Normal and
χ2 distribution).
The weight
argument always refers to the first weight of a pair of
weights. For example, in case of max.comb.test = FALSE
the standard
combination test requires two weights (w, 1-w) but only the first one, w,
is required as input argument here because the second weight is
automatically specified once the first is given. Similarly for
max.comb.test = TRUE
, w and w* need to be specified, which in turn
define the two pairs of weights (w, 1-w) and (w*, 1-w*).
If ssr.conditional = "error_power"
, the design scheme generally
calculates the estimated conditional target power of the second stage and
uses this value as desired target power in the sample size re-estimation process:
If fCpower
> targetpower
, then the conditional estimated
target power may be negative. This does not seem sensible. Therefore, for such
cases the desired target power for the sample size re-calculation will be set
to targetpower
, i.e. ssr.conditional
will be set to "error"
.
Returns an object of class "pwrtsd"
with all the input arguments and results
as components. As part of the input arguments a component cval
is also
presented, containing the critical values for stage 1 and 2 according to the
input based on alpha
, weight
and max.comb.test
.
The class "pwrtsd"
has an S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_stop_s1 |
Percentage of studies stopped after stage 1 (due to BE or due to futility). |
pct_stop_fut |
Percentage of studies stopped after stage 1 due to futility. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total). |
nrange |
Range (min, max) of n(total). |
nperc |
Vector of percentiles of the distribution of n(total). |
B. Lang
König F, Wolfsegger M, Jaki T, Schütz H, Wassmer G.
Adaptive two-stage bioequivalence trials with early stopping and sample size re-estimation.
Vienna: 2014; 35th Annual Conference of the International Society for Clinical Biostatistics. Poster P1.2.88
doi:10.13140/RG.2.1.5190.0967.
Patterson SD, Jones B. Bioequivalence and Statistics in Clinical Pharmacology.
Boca Raton: CRC Press; 2nd edition 2017.
Kieser M, Rauch G. Two-stage designs for cross-over bioequivalence trials.
Stat Med. 2015; 34(16): 2403–16. doi:10.1002/sim.6487.
Maurer W, Jones B, Chen Y. Controlling the type 1 error rate in two-stage
sequential designs when testing for average bioequivalence.
Stat Med. 2018; 37(10): 1587–1607. doi:10.1002/sim.7614.
Wassmer G, Brannath W. Group Sequential and Confirmatory Adaptive Designs
in Clinical Trials.
Springer 2016. doi:10.1007/978-3-319-32562-0.
# 12 subjects in stage 1, CV of 20%, no futility rule, otherwise all defaults # except too low number of sims due to CRAN policy for run-time of examples # This setting resembles values in Table 6.8 and 6.10 in Patterson and Jones # if nsims=1e5 (default) power.tsd.in(n1 = 12, CV = 0.2, fCrit = "No", nsims=1e4) # Note that actual replication would require the following additional # arguments (extremely long run-time) ## Not run: power.tsd.in(n1 = 12, CV = 0.2, fCrit = "No", max.n = 4000, pmethod = "exact", nsims = 1E6) ## End(Not run) # Table 8 in Maurer et al power.tsd.in(n1 = 36, CV = 0.4, max.n = 4000) # Same example as before but with additional futility criterion regarding # maximum sample size (using the default 4*n1 as maximum bound) power.tsd.in(n1 = 36, CV = 0.4, max.n = 4000, fCrit = c("CI", "Nmax"))
# 12 subjects in stage 1, CV of 20%, no futility rule, otherwise all defaults # except too low number of sims due to CRAN policy for run-time of examples # This setting resembles values in Table 6.8 and 6.10 in Patterson and Jones # if nsims=1e5 (default) power.tsd.in(n1 = 12, CV = 0.2, fCrit = "No", nsims=1e4) # Note that actual replication would require the following additional # arguments (extremely long run-time) ## Not run: power.tsd.in(n1 = 12, CV = 0.2, fCrit = "No", max.n = 4000, pmethod = "exact", nsims = 1E6) ## End(Not run) # Table 8 in Maurer et al power.tsd.in(n1 = 36, CV = 0.4, max.n = 4000) # Same example as before but with additional futility criterion regarding # maximum sample size (using the default 4*n1 as maximum bound) power.tsd.in(n1 = 36, CV = 0.4, max.n = 4000, fCrit = c("CI", "Nmax"))
This function calculates the ‘empiric’ power of 2-stage BE studies according to Potvin et al. via simulations. The Potvin methods are modified as described by Karalis & Macheras to include a futility criterion Nmax and to perform the power calculation steps and the sample size estimation step in the decision schemes with the MSE (calculated from CV) and the point estimate (PE) of T/R from stage 1.
power.tsd.KM(method = c("C", "B"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, CV, targetpower = 0.8, pmethod = c("nct", "exact"), Nmax = 150, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd.KM(method = c("C", "B"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, CV, targetpower = 0.8, pmethod = c("nct", "exact"), Nmax = 150, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
method |
Decision schemes according to Potvin et al. |
alpha0 |
Alpha value for the first step(s) in Potvin C aka TSD of Karalis &
Macheras or TSD-1 of Karalis, the power inspection and BE decision
if power > targetpower. |
alpha |
Vector (two elements) of the nominal alphas for the two stages. |
n1 |
Sample size of stage 1. |
CV |
Coefficient of variation of the intra-subject variability (use e.g., 0.3 for 30%). |
targetpower |
Power threshold in the first step of Potvin |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
Nmax |
Futility criterion. If set to a finite value all studies simulated in which
a sample size >Nmax is obtained will be regarded as BE=FAIL. Defaults to 150,
as recommended by Karalis & Macheras. |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing,
defaults to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described in Potvin
et al.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, SS2 are
simulated via their associated distributions (normal and
χ2 distributions).
In contrast to Potvin et al. the power calculation steps as well as the
sample size adaption step of the decision schemes are done using the MSE
(calculated from CV) and the point estimate from
stage 1.
This resembles the methods described in Karalis & Macheras and Karalis.
Returns an object of class "pwrtsd"
with all the input arguments and results
as components.
The class "pwrtsd"
has a S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total). |
nrange |
Range (min, max) of n(total). |
nperc |
Percentiles of the distribution of n(total). |
ntable |
Object of class |
D. Labes
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA. Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
Karalis V, Macheras P. An Insight into the Properties of a Two-Stage Design in Bioequivalence Studies.
Pharm Res. 2013; 30(7):1824–35. doi:10.1007/s11095-013-1026-3
Karalis V. The role of the upper sample size limit in two-stage bioequivalence designs.
Int J Pharm. 2013; 456(1):87–94. doi:10.1016/j.ijpharm.2013.08.013
Fuglsang A. Futility Rules in Bioequivalence Trials with Sequential Designs.
AAPS J. 2014; 16(1):79–82. doi:10.1208/s12248-013-9540-0
Schütz H. Two-stage designs in bioequivalence trials.
Eur J Clin Pharmacol. 2015; 71(3):271–81. doi:10.1007/s00228-015-1806-2
# using all the defaults # but too low number of sims to complain with the CRAN policy: # "check time only a few seconds per example" # minimum number of sims should be 1E5 for power, 1E6 sims for 'alpha' power.tsd.KM(n1=16, CV=0.2, nsims=1E4) # ~3 sec if nsims=1E5
# using all the defaults # but too low number of sims to complain with the CRAN policy: # "check time only a few seconds per example" # minimum number of sims should be 1E5 for power, 1E6 sims for 'alpha' power.tsd.KM(n1=16, CV=0.2, nsims=1E4) # ~3 sec if nsims=1E5
This functions calculate the ‘empirical’ power of 2-stage BE studies
with 2 parallel groups according to Fuglsang 2014 via simulations. The Potvin decision
schemes are modified to include a futility criterion Nmax, a minimum number of
subjects to be included in stage 2 and to allow the sample size estimation
step to be done with point estimate and variabilities from
stage 1 (fully adaptive).
Function power.tsd.pAF()
performes exactly as described in
Fuglsang’s paper, namely the power monitoring steps and the sample
size estimation are based always on the pooled t-test.
Function power.tsd.p()
with argument test="welch"
on the
other hand uses the genuine power of Welch’s test. Moreover it
accepts unequal treatment groups in stage 1.
power.tsd.p(method = c("B", "C"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, Nmax = Inf, min.n2=0, test = c("welch", "t-test", "anova"), theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE) power.tsd.pAF(method = c("B", "C"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("shifted", "nct", "exact"), usePE = FALSE, Nmax = Inf, test = c("welch", "t-test", "anova"), theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd.p(method = c("B", "C"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted"), usePE = FALSE, Nmax = Inf, min.n2=0, test = c("welch", "t-test", "anova"), theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE) power.tsd.pAF(method = c("B", "C"), alpha0 = 0.05, alpha = c(0.0294, 0.0294), n1, GMR, CV, targetpower = 0.8, pmethod = c("shifted", "nct", "exact"), usePE = FALSE, Nmax = Inf, test = c("welch", "t-test", "anova"), theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
method |
Decision schemes according to Potvin et.al. (defaults to |
alpha0 |
Alpha value for the first step(s) in Potvin |
alpha |
Vector (two elements) of the nominal alphas for the two stages. |
n1 |
Sample size of stage 1. |
GMR |
Ratio T/R to be used in decision scheme (power calculations in stage 1 and sample size estimation for stage 2). |
CV |
Coefficient of variation of the total variability
(use e.g., 0.3 for 30%) |
targetpower |
Power threshold in the power monitoring steps and power to achieve in the sample size estimation step. |
pmethod |
Power calculation method, also to be used in the sample size estimation for
stage 2. |
usePE |
If |
Nmax |
Futility criterion. If set to a finite value, all studies simulated in which a
sample size |
min.n2 |
Minimum sample size of stage 2. |
test |
Test on which the CI calculations are based on. |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing,
defaults to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described by Fuglsang.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data the statistics (mean and variance of Test
and Reference of stage 1 and
stage 2) are simulated via their associated
distributions (normal and χ2).
Returns an object of class "pwrtsd"
with all the input arguments and results
as components.
The class "pwrtsd"
has an S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pBE_s1 |
Fraction of studies found BE in stage 1. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total). |
nrange |
Range (min, max) of n(total). |
nperc |
Percentiles of the distribution of n(total). |
ntable |
Object of class |
D. Labes
Fuglsang A. Sequential Bioequivalence Approaches for Parallel Design.
AAPS J. 2014; 16(3):373–8. doi:10.1208/s12248-014-9571-1
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA. Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
power.2stage
for analogous calculations for the 2×2 crossover.
# using all the defaults power.tsd.p(n1=48, CV=0.25)
# using all the defaults power.tsd.p(n1=48, CV=0.25)
This function calculates the ‘empiric’ power (via simulations) of 2-stage BE studies with interim sample size re-estimation (i.e., but no BE decision after stage 1). The sample size re-estimation can be done blinded or unblinded.
power.tsd.ssr(alpha = 0.05, n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted", "ls"), blind = FALSE, usePE = FALSE, min.n = 0, max.n = Inf, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
power.tsd.ssr(alpha = 0.05, n1, GMR, CV, targetpower = 0.8, pmethod = c("nct", "exact", "shifted", "ls"), blind = FALSE, usePE = FALSE, min.n = 0, max.n = Inf, theta0, theta1, theta2, npct = c(0.05, 0.5, 0.95), nsims, setseed = TRUE, details = FALSE)
alpha |
Nominal type I error. Has to be adjusted in case of inflation of the Type I Error. |
n1 |
Sample size of stage 1. |
GMR |
Ratio T/R to be used in the sample size re-estimation. |
CV |
Coefficient of variation of the intra-subject variability
(use e.g., 0.3 for 30%). |
targetpower |
Power to achieve in the sample size estimation step. |
pmethod |
Power calculation method to be used in the sample size re-estimation for
stage 2. |
blind |
If |
usePE |
If |
min.n |
If |
max.n |
If |
theta0 |
Assumed ratio of geometric means (T/R) for simulations. If missing, defaults
to |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
npct |
Percentiles to be used for the presentation of the distribution of
|
nsims |
Number of studies to simulate. |
setseed |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a
|
details |
If set to |
The calculations follow in principle the simulations as described in Potvin
et al.
The underlying subject data are assumed to be evaluated after log-transformation.
But instead of simulating subject data, the statistics pe1, mse1 and pe2, SS2 are
simulated via their associated distributions (normal and
χ2 distributions).
Returns an object of class class "pwrtsd"
with all the input arguments and results
as components.
The class class "pwrtsd"
has a S3 print method.
The results are in the components:
pBE |
Fraction of studies found BE. |
pct_s2 |
Percentage of studies continuing to stage 2. |
nmean |
Mean of n(total). |
nrange |
Range (min, max) of n(total). |
nperc |
Percentiles of the distribution of n(total). |
ntable |
Object of class |
The computation time is in the magnitude of a few seconds for 100,000 sim’s
on my machine (Intel core i7 2.5 GHz, 12GB RAM) if the non-central t
approximation is used. Thus be a bit patient if you simulate for the Tpye I Error
'alpha' with 1 Mio sim’s.
Using the crude pmethod="ls"
on the other hand results in a nearly immediate
sample size re-estimation.
D. Labes
Golkowski D, Friede T, Kieser M. Blinded sample size re-estimation in crossover bioequivalence trials.
Pharm Stat. 2014; 13(3):157–62. doi:10.1002/pst.1617
Jones B, Kenward MG. Design and Analysis of Cross-Over Trials.
Boca Raton: CRC Press; 3rd edition 2014. Chapter 12.
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA. Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
power.tsd
for 2-stage studies with interim BE decision.
# Not run to comply with CRAN policy about examples' run-time; # minimum number of sim's should be 1E5 for 'power', 1E6 sim's for 'alpha' ## Not run: power.tsd.ssr(alpha=0.05, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="ls", blind=TRUE, theta0=1.25) # should give an alpha-inflation 0.072359 (run time <5 seconds) # repeated with noncentral t-approximation power.tsd.ssr(alpha=0.05, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="nct", blind=TRUE, theta0=1.25) # should give an alpha-inflation 0.069789 (run time ~20 seconds) # # adjusted alpha to control the Type I Error, noncentral t-approx. power.tsd.ssr(alpha=0.03505, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="nct", blind=TRUE, theta0=1.25) # should control the TIE with 0.049877 ## End(Not run)
# Not run to comply with CRAN policy about examples' run-time; # minimum number of sim's should be 1E5 for 'power', 1E6 sim's for 'alpha' ## Not run: power.tsd.ssr(alpha=0.05, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="ls", blind=TRUE, theta0=1.25) # should give an alpha-inflation 0.072359 (run time <5 seconds) # repeated with noncentral t-approximation power.tsd.ssr(alpha=0.05, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="nct", blind=TRUE, theta0=1.25) # should give an alpha-inflation 0.069789 (run time ~20 seconds) # # adjusted alpha to control the Type I Error, noncentral t-approx. power.tsd.ssr(alpha=0.03505, n1=10, GMR=1, CV=0.239, targetpower=0.9, pmethod="nct", blind=TRUE, theta0=1.25) # should control the TIE with 0.049877 ## End(Not run)
This function estimates the necessary sample size of stage 2 to have at least a given power.
sampleN2.TOST(alpha = 0.0294, CV, n1, theta0 = 0.95, theta1 = 0.8, theta2 = 1.25, targetpower = 0.8, design = "2x2", method = "exact", imax = 100)
sampleN2.TOST(alpha = 0.0294, CV, n1, theta0 = 0.95, theta1 = 0.8, theta2 = 1.25, targetpower = 0.8, design = "2x2", method = "exact", imax = 100)
alpha |
Alpha value for the final analysis of pooled data. Defaults to Pocock’s
alpha setting |
CV |
Coefficient of variation of the intra-subject variability as ratio. |
n1 |
Sample size of stage 1. |
theta0 |
True ratio of T/R for simulating. Defaults to 0.95 argument if missing. |
theta1 |
Lower bioequivalence limit. Defaults to 0.8. |
theta2 |
Upper bioequivalence limit. Defaults to 1.25. |
targetpower |
Power to achieve at least. Must be >0 and <1. |
design |
Character string describing the study design. Implemented are |
method |
Method for calculation of the power. Implemented are |
imax |
Maximum number of steps in sample size search. |
The sample size is calculated via iterative evaluation of power of the
TOST procedure.
Start value for the sample size search is taken from a large sample
approximation according to Zhang, modified.
A data.frame with the input and results will be returned.
The "Sample size" column contains the sample size for the second stage.
Since in the final analysis one degree of freedom less than in a fixed sample
design (or in stage 1) is used, power will
be slightly lower than the one obtained with function sampleN.TOST
of
package PowerTOST
. However, different sample sizes are extremely
unlikely.
H. Schütz, D. Labes
Potvin D, DiLiberti CE, Hauck WW, Parr AF, Schuirmann DJ, Smith RA.
Sequential design approaches for bioequivalence studies with crossover designs.
Pharm Stat. 2008; 7(4):245–62. doi:10.1002/pst.294
Zhang P. A Simple Formula for Sample Size Calculation in Equivalence Studies.
J Biopharm Stat. 2003; 13(3):529–38. doi:10.1081/BIP-120022772
# using all the defaults, CV of 25% and 12 subjects in stage 1 print(sampleN2.TOST(CV=0.25, n1=12), row.names=FALSE) # should give a stage 2 sample size of 22 and achieved power ~0.812 # CV 10% and 12 subjects in stage 1 print(sampleN2.TOST(CV=0.1, n1=12), row.names=FALSE) # should give a sample size of 0 (second stage not reasonable # since power ~0.973 was already achieved in stage 1)
# using all the defaults, CV of 25% and 12 subjects in stage 1 print(sampleN2.TOST(CV=0.25, n1=12), row.names=FALSE) # should give a stage 2 sample size of 22 and achieved power ~0.812 # CV 10% and 12 subjects in stage 1 print(sampleN2.TOST(CV=0.1, n1=12), row.names=FALSE) # should give a sample size of 0 (second stage not reasonable # since power ~0.973 was already achieved in stage 1)