optimize_design_onestage {OptimalGoldstandardDesigns} | R Documentation |
Calculate optimal design parameters for a single-stage gold-standard design
Description
Calculate optimal design parameters for a single-stage gold-standard design
Usage
optimize_design_onestage(
cP1 = NULL,
cC1 = NULL,
alpha = 0.025,
beta = 0.2,
alternative_TP = 0.4,
alternative_TC = 0,
Delta = 0.2,
varT = 1,
varP = 1,
varC = 1,
round_n = TRUE,
kappa = 0,
objective = quote(sum(unlist(n)) + kappa * n[[1]][["P"]]),
inner_tol_objective = 1e-07,
mvnorm_algorithm = mvtnorm::Miwa(steps = 4097, checkCorr = FALSE, maxval = 1000),
nloptr_x0 = NULL,
nloptr_lb = NULL,
nloptr_ub = NULL,
nloptr_opts = list(algorithm = "NLOPT_LN_SBPLX", ftol_rel = 1e-09, xtol_abs = 1e-08,
xtol_rel = 1e-07, maxeval = 1000, print_level = 0),
print_progress = TRUE,
...
)
Arguments
cP1 |
(numeric) allocation ratio nP1 / nT1. Parameter to be optimized if left unspecified. |
cC1 |
(numeric) allocation ratio nC1 / nT1. Parameter to be optimized if left unspecified. |
alpha |
type I error rate. |
beta |
type II error rate. |
alternative_TP |
assumed difference between T and P under H1. Positive values favor T. |
alternative_TC |
assumed difference between T and C under H1. Positive values favor T. |
Delta |
non-inferiority margin for the test |
varT |
variance of treatment group. |
varP |
variance of placebo group. |
varC |
variance of control group. |
round_n |
(logical) if TRUE, a design with integer valued sample sizes is returned. |
kappa |
(numeric) penalty factor for placebo patients in the default objective function. |
objective |
(expression) objective criterion. |
inner_tol_objective |
(numeric) used to determine the tolerances for integrals and nuisance optimization problems inside the objective function. |
mvnorm_algorithm |
algorithm for multivariate integration passed to |
nloptr_x0 |
(numeric vector) starting point for optimization. |
nloptr_lb |
(numeric vector) lower bound box for box constrained optimization. |
nloptr_ub |
(numeric vector) upper bound box for box constrained optimization. |
nloptr_opts |
(list) nloptr options. See |
print_progress |
(logical) controls whether optimization progress should be visualized during the calculation. |
... |
additional arguments passed along. |
Details
This function calculates optimal design parameters for a two-stage three-arm gold-standard
non-inferiority trial. Run vignette("Introduction", package = "OptimalGoldstandardDesigns")
to see some examples related to the associated paper (Meis et al. 2023).
Parameters which can be optimized are the allocation ratios for all groups and stages and the futility and efficacy boundaries of the first stage. The allocation ratios are cT2 = nT2 / nT1, cP1 = nP1 / nT1, cP2 = nP2 / nT1, cC1 = nC1 / nT1 and cC2 = nC2 / nT1. Here, nT1 denotes the sample size of the treatment group in the first stage, nP2 the sample size of the placebo group in the second stage, etc. The first stage efficacy boundaries are bTP1e for the treatment vs placebo testing problem, and bTC1e for the treatment vs control non-inferiority testing problem. The futility boundaries are denoted by bTP1f and bTC1f.
If these parameters are left unspecified or set to NULL, they will be included into the
optimization process, otherwise they will be considered boundary constraints.
You may also supply quoted expressions as arguments for these
parameters to solve a constrained optimization problem. For example, you can supply
cT2 = 1, cP2 = quote(cP1), cC2 = quote(cC1)
to ensure that the first and second
stage allocation ratios are equal.
The design is optimized with respect to the objective criterion given by the parameter
objective
. By default, this is the overall sample size plus an optional
penalty for the placebo group sample size, controlled by the parameter kappa
.
Designs are calculated to fulfill the following constraints: the family-wise type I error
rate is controlled at alpha
under any combination of the two null hypotheses
muT - muP = 0
and muT - muC + Delta = 0
.
The power to reject both hypothesis given both alternative
hypotheses muT - muP = alternative_TP
and muT - muC + Delta = alternative_TC + Delta
is at least 1 - beta
. Variances are assumed to be given by varT, varP
and varC
.
If binding_futility
is TRUE
, type I error recycling is used.
If always_both_futility_tests
is TRUE
, it is assumed that futility tests for both
hypotheses are performed at interim, regardless of whether the treatment vs placebo null hypothesis
was successfully rejected. If always_both_futility_tests
is FALSE
, the futility
test for the treatment vs. control testing problem only needs to be done if the null for the
treatment vs. placebo testing problem was rejected in the first stage.
Value
Design object (a list) with optimized design parameters.
References
Meis J, Pilz M, Herrmann C, Bokelmann B, Rauch G, Kieser M (2023). “Optimization of the two-stage group sequential three-arm gold-standard design for non-inferiority trials.” Statistics in Medicine, 42(4), 536-558. doi:10.1002/sim.9630.
Examples
# Should take about 2 second with the chosen accuracy
optimize_design_onestage(
alpha = .025,
beta = .2,
alternative_TP = .4,
alternative_TC = 0,
Delta = .2,
mvnorm_algorithm = mvtnorm::Miwa(steps = 512, checkCorr = FALSE, maxval = 1000),
nloptr_opts = list(algorithm = "NLOPT_LN_SBPLX", ftol_rel = 1e-03, xtol_abs = 1e-08,
xtol_rel = 1e-07, maxeval = 1000, print_level = 0)
)