Skip to contents

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(K=4, J=2, alpha=0.05, power=0.9, r=1:2, r0=1:2, p=0.75, p0=0.5, 
     delta=NULL, delta0=NULL, sd=NULL, ushape="obf", lshape="fixed",
     ufix=NULL, lfix=0, nstart=1, nstop=NULL, sample.size=TRUE, N=20,
     type="normal", parallel=TRUE, print=TRUE)

Arguments

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).

delta

Interesting treatment effect on the traditional scale. See Details (default=NULL).

delta0

Uninteresting treatment effect on the traditional scale. See Details (default=NULL).

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).

N

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 parallelisation 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 parallelisation.

print

if TRUE (default), indicate at which stage the computation is.

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 paramterization is that no knowledge about the variance is required. To convert traditional effect sizes, \(\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 compuation time.

For designs with more than 2 stages, parallelisation of the computation by means of the packages future and future.apply lead to decreased computation times when choosing a parallelisation 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).

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.

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., 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.

Author

Thomas Jaki, Dominic Magirr and Dominique-Laurent Couturier

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
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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

## 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
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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

## 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)
#>       
#> .
#> .
#> .
#> .
#> 
#> 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

# 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)
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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

## Example of a custom boundary function without sample size evaluation
mams(K=6, J=3, alpha=0.05, power=0.9, r=1:3, r0=1:3, p=0.7, p0=0.5, 
     ushape=function(x)return(x:1), lshape="fixed", lfix=0, 
     sample.size=FALSE)
#> 
#>    i) find lower and upper boundaries
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#>   ii) define alpha star
#> Design parameters for a 3 stage trial with 6 treatments
#> 
#>              Stage 1 Stage 2 Stage 3
#> Upper bound:   6.834   4.556   2.278
#> Lower bound:   0.000   0.000   2.278

## 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)
#>       
#> .
#> .
#> .
#> .
#> .
#> 
#> 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

## 
## example considering different parallelisation 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)
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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
#>    user  system elapsed 
#>   50.04    0.28  117.91 
# 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)
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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
#>    user  system elapsed 
#>   14.08    0.06   71.95 
# 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)
#>       
#> .
#> .
#> .
#> .
#> .
#> .
#> 
#> 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
#>    user  system elapsed 
#>   16.86    0.41   50.73 
plan("default")       
     
# }