mams.sim | R Documentation |
The function simulates multi-arm multi-stage designs and estimates power and expected sample size.
mams.sim(obj=NULL,nsim=NULL, nMat=NULL,
u=NULL, l=NULL, pv=NULL, deltav=NULL, sd=NULL, ptest=NULL,
parallel=NULL, H0=NULL, K = NULL)
obj |
an object of class |
nsim |
Number of simulations (default='50000“). |
nMat |
Jx(K+1) dimensional matrix of observed/expected sample sizes.
Rows correspond to stages and columns to arms. First column is control
(default: |
u |
Vector of previously used upper boundaries (default= |
l |
Vector of previously used upper boundaries (default= |
pv |
Vector of size K of true treatment effects on the probability
scale. See Details (default= |
deltav |
Vector of size K of true treatment effects on the traditional
scale. See Details (default= |
sd |
Standard deviation. See Details (default= |
ptest |
Vector of treatment numbers for determining power.
For example, c(1, 2) will count rejections of one or both hypotheses for
testing treatments 1 and 2 against control (default= |
parallel |
if |
H0 |
if |
K |
Allocation for treatment arms (used only with method = "dtl") |
This function simulates multi-arm multi-stage studies for a given matrix of
sample sizes and boundaries given by the vectors u
and l
.
The effect difference between each experimental treatment and control is
given by pv
and is 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 pv=rep(0.5,4)
the experimental treatments and control perform equally
well (i.e. the global null hypothesis is true).
The advantage of this parameterization 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 effect size can also be specified directly on the
traditional scale of deltav
with an additional specification of
the standard deviation sd
.
he function returns the probability of rejecting any hypothesis (typeI
),
the power to reject the first hypothesis when the first treatment has the
largest estimated effect, the proportion of rejections of the hypothesis
specified by ptest
(prop.rej
) as well as the expected
sample size.
An object 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. |
rMat |
Matrix of allocation ratios. First row corresponds to control and second row to experimental treatments. |
nsim |
Number of simulation runs. |
typeI |
The proportion any hypothesis is rejected. |
power |
The proportion the first hypothesis is rejected and the corresponding test statistic is largest. |
ptest |
The vector |
prop.rej |
The proportion of times at least one of the hypothesis
specified by |
exss |
The expected sample size. |
Thomas Jaki, Dominic Magirr and Dominique-Laurent Couturier
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: \Sexpr[results=rd]{tools:::Rd_expr_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: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/ass002")}
mams, MAMS.
# Note that some of these examples may take a few minutes to run
# 2-stage design with O'Brien & Fleming efficacy and zero futility boundary
# with equal sample size per arm and stage. Design can be found using
# mams(K=4, J=2, alpha=0.05, power=0.9, r=1:2, r0=1:2, ushape="obf",
# lshape="fixed",
# lfix=0, p=0.65, p0=0.55)
# under global null hypothesis (using the pv scale)
mams.sim(nsim=10000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=rep(0.5, 4), ptest=1)
# under global null hypothesis (using the deltav scale)
mams.sim(nsim=10000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=NULL, deltav=rep(0, 4), sd=1, ptest=1)
# under LFC
mams.sim(nsim=10000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=c(0.65, 0.55, 0.55, 0.55), ptest=1:2)
# when all treatments doing similarly well
mams.sim(nsim=10000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=c(0.63, 0.62, 0.60, 0.61), ptest=4)
##
## example considering different parallelisation strategies
##
# parallel = FALSE (future framework not used)
set.seed(1)
system.time(
print(mams.sim(nsim=25000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=c(0.65, 0.55, 0.55, 0.55),
ptest=1:2, parallel=FALSE))
)
# parallel = TRUE (default) with default strategy (sequential computation)
plan(sequential)
set.seed(1)
system.time(
print(mams.sim(nsim=25000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=c(0.65, 0.55, 0.55, 0.55), ptest=1:2))
)
# parallel = TRUE (default) with multisession strategy (parallel computation)
plan(multisession)
set.seed(1)
system.time(
print(mams.sim(nsim=25000, nMat=matrix(c(44, 88), nrow=2, ncol=5),
u=c(3.068, 2.169),
l=c(0.000, 2.169), pv=c(0.65, 0.55, 0.55, 0.55), ptest=1:2))
)
plan("default")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.