Function to design multi-arm multi-stage studies with normal endpoints
MAMS.Rd
The function determines the boundaries of a multi-arm multi-stage study for a given boundary shape and finds the required number of subjects.
Usage
mams(obj = NULL, K=NULL, J=NULL, alpha=NULL, power=NULL, r=NULL,
r0=NULL, p=NULL, p0=NULL, delta=NULL, delta0=NULL,
sd=NULL,ushape=NULL, lshape=NULL, ufix=NULL, lfix=NULL,
nstart=NULL, nstop=NULL, sample.size=NULL, Q=NULL,
type=NULL, parallel=NULL, print=NULL, nsim=NULL,
H0=NULL, method=NULL)
Arguments
- obj
object of class
MAMS
- K
Number of experimental treatments (default=4).
- J
Number of stages (default=2).
- alpha
One-sided familywise error rate (default=0.05).
- power
Desired power (default=0.9).
- r
Vector of allocation ratios (default=1:2).
- r0
Vector ratio on control (default=1:2).
- p
Interesting treatment effect on the probability scale. See Details (default=0.75).
- p0
Uninteresting treatment effect on the probability scale. See Details (default=0.5). Note that this parameter affects the sample size estimation to ensure that Treatment 1 is best only when selecting the simultaneous stopping rule (i.e., 'method = "simultaneous"') and, for all methods, as values for treatment arms 2 to K in the simulations under H1.
- delta
Interesting treatment effect on the traditional scale. See Details (default=NULL).
- delta0
Uninteresting treatment effect on the traditional scale. See Details (default=NULL). Note that this parameter affects the sample size estimation to ensure that Treatment 1 is best only when selecting the simultaneous stopping rule (i.e., 'method = "simultaneous"') and, for all methods, as values for treatment arms 2 to K in the simulations under H1.
- sd
Standard deviation, assumed to be known. See Details (default=NULL).
- ushape
Shape of upper boundary. Either a function specifying the shape or one of "pocock", "obf" (the default), "triangular" and "fixed". See details.
- lshape
Shape of lower boundary. Either a function specifying the shape or one of "pocock", "obf", "triangular" and "fixed" (the default). See details.
- ufix
Fixed upper boundary (default=NULL). Only used if shape="fixed".
- lfix
Fixed lower boundary (default=0). Only used if shape="fixed".
- nstart
Starting point for finding the sample size (default=1).
- nstop
Stopping point for finding the sample size (default=NULL).
- sample.size
Logical if sample size should be found as well (default=TRUE).
- Q
Number of quadrature points per dimension in the outer integral (default=20).
- type
Will be changed automatically by the wrappers tite.mams() (to "tite") and ordinal.mams() (to "ordinal") to customise the output.
- parallel
if TRUE (default), allows parallelization of the computation via a user-defined strategy specified by means of the function future::plan(). If not set differently, the default strategy is sequential, which corresponds to a computation without parallelization.
if TRUE (default), indicate at which stage the computation is.
- nsim
a scalar indicating the number of simulations (default = 50'000, minimum = 1000)
- H0
if TRUE (default), the simulation also considers the case with all effect sizes set to 0.
- method
Type of the desired design:
simultaneous
(default) for simultaneous stopping rules,sep
for separate stopping, anddtl
for drop-the-losers design.
Value
An object of the class MAMS containing the following components:
- l
Lower boundary.
- u
Upper boundary.
- n
Sample size on control in stage 1.
- N
Maximum total sample size.
- K
Number of experimental treatments.
- J
Number of stages in the trial.
- alpha
Familywise error rate.
- alpha.star
Cumulative familywise error rate spent by each analysis.
- power
Power under least favorable configuration.
- rMat
Matrix of allocation ratios. First row corresponds to control while subsequent rows are for the experimental treatments.
- sim
a list indicating, for each hypothesis of interest (null and/or alternative), the expected sample size and standard deviation per group (ess), the cumulated probability of efficacy (efficacy) and futility (futility) per treatment arm and look
- input
the list of all input parameters except K and J
Details
This function finds the boundaries and sample size of a multi-arm multi-stage study with K active treatments plus control in which all promising treatments are continued at interim analyses as described in Magirr et al (2012). At each interim analysis the test statistics are compared to the lower (futility) bound and any treatment whose corresponding test statistic falls below that bound is discontinued. Similarly if any test statistic exceeds the upper (efficacy) bound the null hypothesis corresponding to that treatment can be rejected and superiority of that treatment over control claimed. At the same time the study is stopped. If at least one test statistic exceeds the lower bound and none exceeds the upper bound the study is continued and further patients are recruited to all remaining experimental treatments plus control.
The design is found under the least favorable configuration, which requires
an interesting treatment effect p
that if present we would like to find
with
high probability and an uninteresting effect p0
. Both p
and p0
are
parameterized as \(P(X_k > X_0 ) = p\), that is the
probability of a randomly selected person on treatment k observing a
better outcome than a random person on control. For p=0.5
the experimental
treatment and control perform equally well.
The advantage of this parameterization is that no knowledge about the
variance is required. To convert traditional effect sizes,
d\(\delta\)
to this format use
\(p=\Phi(\frac{\delta}{\sqrt{2}\sigma})\).
Alternatively, the interesting and uninteresting effect size can also be
specified directly on the traditional scale of delta
and delta
with an
additional specification of the standard deviation sd
assumed to be known.
The shape of the boundaries (ushape
, lshape
) are either using the
predefined shapes following Pocock (1977), O'Brien & Fleming (1979) or the
triangular Test (Whitehead, 1997) using options "pocock"
, "obf"
or
"triangular"
respectively, are constant (option "fixed"
) or supplied
in as a function.
If a function is passed it should require exactly one argument specifying
the number of stages and return a vector of the same length. The lower
boundary shape is required to be non-decreasing while the upper boundary
shape needs to be non-increasing. If a fixed lower boundary is used, lfix
must be smaller than \(\Phi^{-1}(1-\alpha)/2\)
to ensure that it is smaller than the upper boundary.
The default starting point for finding the sample size is nstart=1
, and
the default point where the search is stopped (when nstop=NULL
) is 3
times the sample size of the corresponding fixed single-stage design.
Computation of designs with more than four stages are very time consuming
and not advised. The parameter sample.size
controls whether the required
sample size is computed as well. Setting to FALSE
approximately halves
the computation time.
For designs with more than 2 stages, parallelization of the computation by
means of the packages future and future.apply lead to decreased
computation times when choosing a parallelization strategy like, for
example, multicore
(using separate forked R processes, available to
unix/osx users) or multisession
(using separate R sessions, available
to all users) (refer to future::plan() for detail).
References
Jaki T., Pallmann P., and Magirr D. (2019), The R Package MAMS for Designing Multi-Arm Multi-Stage Clinical Trials, Journal of Statistical Software, 88(4), 1-25. Link: doi:10.18637/jss.v088.i04
Magirr D., Jaki T., and Whitehead J. (2012), A generalized Dunnett test for multi-arm multi-stage clinical studies with treatment selection, Biometrika, 99(2), 494-501. Link: doi:10.1093/biomet/ass002
Pocock S.J. (1977), Group sequential methods in the design and analysis of clinical trials, Biometrika, 64(2), 191-199.
O'Brien P.C., and Fleming T.R. (1979), A multiple testing procedure for clinical trials, Biometrics, 35(3), 549-556.
Whitehead J. (1997), The Design and Analysis of Sequential Clinical Trials, Wiley: Chichester, UK. Wason J, Stallard N, Bowden J, Jennison C. A multi-stage drop-the-losers design for multi-arm clinical trials. Statistical Methods in Medical Research. 2017;26(1):508-524. doi:10.1177/0962280214550759
Examples
# \donttest{
## A fixed sample (single stage) design specified on the p scale
mams(K=4, J=1, alpha=0.05, power=0.9, r=1, r0=1, p=0.65, p0=0.55)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 252)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> 50
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 1 stage trial with 4 treatments:
#>
#> Stage 1
#> Cumulative sample size per stage (control): 84
#> Cumulative sample size per stage (active): 84
#>
#> Maximum total sample size: 420
#>
#> Stage 1
#> Upper bound: 2.16
#> Lower bound: 2.16
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.917
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.902
#> Prop. rejecting hypothesis 1: 0.914
#> Expected sample size: 420.000
#>
## The same design specified on the delta scale
mams(K=4, J=1, alpha=0.05, power=0.9, r=1, r0=1, p=NULL, p0=NULL,
delta=0.545, delta0=0.178, sd=1)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 252)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> 50
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 1 stage trial with 4 treatments:
#>
#> Stage 1
#> Cumulative sample size per stage (control): 84
#> Cumulative sample size per stage (active): 84
#>
#> Maximum total sample size: 420
#>
#> Stage 1
#> Upper bound: 2.16
#> Lower bound: 2.16
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.917
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.901
#> Prop. rejecting hypothesis 1: 0.914
#> Expected sample size: 420.000
#>
## An example in Table 1 of Magirr et al (2012)
# 2-stage design with O'Brien & Fleming efficacy and zero futility boundary
mams(K=4, J=2, alpha=0.05, power=0.9, r=1:2, r0=1:2, p=0.65, p0=0.55,
ushape="obf", lshape="fixed", lfix=0, nstart=40)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 348)
#>
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 2 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2
#> Cumulative sample size per stage (control): 44 88
#> Cumulative sample size per stage (active): 44 88
#>
#> Maximum total sample size: 440
#>
#> Stage 1 Stage 2
#> Upper bound: 3.068 2.169
#> Lower bound: 0.000 2.169
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.929
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.907
#> Prop. rejecting hypothesis 1: 0.920
#> Expected sample size: 346.422
#>
## An example of separate stopping rules
# 2-stage design with O'Brien & Fleming efficacy and zero futility boundary
mams(method = "sep",K=4, J=2, alpha=0.05, power=0.9, r=1:2, r0=1:2,
p=0.65, p0=0.55, ushape="obf", lshape="fixed", lfix=0, nstart=40)
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) perform sample size calculation
#> iii) run simulation
#> Design parameters for a 2 stage separate stopping rules trial with K = 4
#>
#> Stage 1 Stage 2
#> Cumulative sample size per stage (control): 41 82
#> Cumulative sample size per stage (active): 41 82
#>
#> Required total sample size: 410
#>
#> Stage 1 Stage 2
#> Upper bound: 3.068 2.169
#> Lower bound: 0.000 2.169
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.909
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.756
#> Prop. rejecting hypothesis 1: 0.904
#> Expected sample size: 371.080
#>
# An example of running drop-the-losers design
# `K` should be defined as vector length of J defining allocation arms per
# stages with final element equal to 1.
mams(method = "dtl", K=c(4,1), J=2, alpha=0.05,
power=0.9, r=1:2, r0=1:2, p=0.65, p0=0.55, ushape="obf",
lshape="fixed", lfix=0, nstart=40)
#> i) find new lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) perform sample size calculation
#> iii) run simulation
#> Design parameters for a 2 stage drop-the-losers trial with Kv = (4, 1)
#>
#> Stage 1 Stage 2
#> Cumulative sample size per stage (control): 52 104
#> Cumulative sample size per stage (active): 52 104
#>
#> Required total sample size: 364
#>
#> Stage 1 Stage 2
#> Upper bound: NA 2.055
#> Lower bound: NA 2.055
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.943
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.902
#> Prop. rejecting hypothesis 1: 0.902
#> Expected sample size: 364.000
#>
# Note that these examples may take a few minutes to run
## 3-stage design with Triangular efficacy and futility boundary
mams(K=4, J=3, alpha=0.05, power=0.9, r=1:3, r0=1:3, p=0.65, p0=0.55,
ushape="triangular", lshape="triangular", nstart=30)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 298)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 3 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2 Stage 3
#> Cumulative sample size per stage (control): 36 72 108
#> Cumulative sample size per stage (active): 36 72 108
#>
#> Maximum total sample size: 540
#>
#> Stage 1 Stage 2 Stage 3
#> Upper bound: 2.706 2.392 2.344
#> Lower bound: 0.000 1.435 2.344
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.941
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.903
#> Prop. rejecting hypothesis 1: 0.921
#> Expected sample size: 284.813
#>
## Different allocation ratios between control and experimental treatments.
## Twice as many patients are randomized to control at each stage.
mams(K=4, J=2, alpha=0.05, power=0.9, r=1:2, r0=c(2, 4), p=0.65,
p0=0.55, ushape="obf", lshape="fixed", lfix=0, nstart=30)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 271)
#>
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 2 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2
#> Cumulative sample size per stage (control): 70 140
#> Cumulative sample size per stage (active): 35 70
#>
#> Maximum total sample size: 420
#>
#> Stage 1 Stage 2
#> Upper bound: 3.12 2.206
#> Lower bound: 0.00 2.206
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.944
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.904
#> Prop. rejecting hypothesis 1: 0.926
#> Expected sample size: 334.666
#>
##
## example considering different parallelization strategies
##
# parallel = FALSE (future framework not used)
set.seed(1)
system.time(
print(mams(K=4, J=3, alpha=0.05, power=0.9, r=1:3, r0=1:3,
p=0.65, p0=0.55, ushape="triangular", lshape="triangular",
nstart=30, parallel = FALSE))
)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 298)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 3 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2 Stage 3
#> Cumulative sample size per stage (control): 36 72 108
#> Cumulative sample size per stage (active): 36 72 108
#>
#> Maximum total sample size: 540
#>
#> Stage 1 Stage 2 Stage 3
#> Upper bound: 2.706 2.392 2.344
#> Lower bound: 0.000 1.435 2.344
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.944
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.906
#> Prop. rejecting hypothesis 1: 0.922
#> Expected sample size: 284.913
#>
#> user system elapsed
#> 90.58 1.35 95.54
# parallel = TRUE (default) with default strategy (sequential computation)
plan(sequential)
set.seed(1)
system.time(
print(mams(K=4, J=3, alpha=0.05, power=0.9, r=1:3, r0=1:3,
p=0.65, p0=0.55, ushape="triangular", lshape="triangular",
nstart=30))
)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 298)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 3 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2 Stage 3
#> Cumulative sample size per stage (control): 36 72 108
#> Cumulative sample size per stage (active): 36 72 108
#>
#> Maximum total sample size: 540
#>
#> Stage 1 Stage 2 Stage 3
#> Upper bound: 2.706 2.392 2.344
#> Lower bound: 0.000 1.435 2.344
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.942
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.904
#> Prop. rejecting hypothesis 1: 0.922
#> Expected sample size: 284.486
#>
#> user system elapsed
#> 143.41 2.48 154.93
# parallel = TRUE(default) with multisession strategy (parallel computation)
plan(multisession)
set.seed(1)
system.time(
print(mams(K=4, J=3, alpha=0.05, power=0.9, r=1:3, r0=1:3,
p=0.65, p0=0.55, ushape="triangular", lshape="triangular",
nstart=30))
)
#>
#> i) find lower and upper boundaries
#>
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> ii) define alpha star
#> iii) perform sample size calculation
#> (maximum iteration number = 298)
#>
#> .
#> .
#> .
#> .
#> .
#> .
#>
#> iv) run simulation
#>
#> Design parameters for a 3 stage trial with 4 treatments:
#>
#> Stage 1 Stage 2 Stage 3
#> Cumulative sample size per stage (control): 36 72 108
#> Cumulative sample size per stage (active): 36 72 108
#>
#> Maximum total sample size: 540
#>
#> Stage 1 Stage 2 Stage 3
#> Upper bound: 2.706 2.392 2.344
#> Lower bound: 0.000 1.435 2.344
#>
#>
#> Simulated error rates based on 50000 simulations:
#>
#> Prop. rejecting at least 1 hypothesis: 0.942
#> Prop. rejecting first hypothesis (Z_1>Z_2,...,Z_K) 0.904
#> Prop. rejecting hypothesis 1: 0.922
#> Expected sample size: 284.486
#>
#> user system elapsed
#> 42.28 2.13 63.78
plan("default")
# }