survival_adapt {goldilocks} | R Documentation |
Simulate and execute a single adaptive clinical trial design with a time-to-event endpoint
Description
Simulate and execute a single adaptive clinical trial design with a time-to-event endpoint
Usage
survival_adapt(
hazard_treatment,
hazard_control = NULL,
cutpoints = 0,
N_total,
lambda = 0.3,
lambda_time = 0,
interim_look = NULL,
end_of_study,
prior = c(0.1, 0.1),
block = 2,
rand_ratio = c(1, 1),
prop_loss = 0,
alternative = "greater",
h0 = 0,
Fn = 0.05,
Sn = 0.9,
prob_ha = 0.95,
N_impute = 10,
N_mcmc = 10,
method = "logrank",
imputed_final = FALSE
)
Arguments
hazard_treatment |
vector. Constant hazard rates under the treatment arm. |
hazard_control |
vector. Constant hazard rates under the control arm. |
cutpoints |
vector. Times at which the baseline hazard changes. Default
is |
N_total |
integer. Maximum sample size allowable |
lambda |
vector. Enrollment rates across simulated enrollment times. See
|
lambda_time |
vector. Enrollment time(s) at which the enrollment rates
change. Must be same length as lambda. See |
interim_look |
vector. Sample size for each interim look. Note: the maximum sample size should not be included. |
end_of_study |
scalar. Length of the study; i.e. time at which endpoint will be evaluated. |
prior |
vector. The prior distributions for the piecewise hazard rate
parameters are each |
block |
scalar. Block size for generating the randomization schedule. |
rand_ratio |
vector. Randomization allocation for the ratio of control
to treatment. Integer values mapping the size of the block. See
|
prop_loss |
scalar. Overall proportion of subjects lost to follow-up. Defaults to zero. |
alternative |
character. The string specifying the alternative
hypothesis, must be one of |
h0 |
scalar. Null hypothesis value of |
Fn |
vector of |
Sn |
vector of |
prob_ha |
scalar |
N_impute |
integer. Number of imputations for Monte Carlo simulation of missing data. |
N_mcmc |
integer. Number of samples to draw from the posterior
distribution when using a Bayesian test ( |
method |
character. For an imputed data set (or the final data set after
follow-up is complete), whether the analysis should be a log-rank
( |
imputed_final |
logical. Should the final analysis (after all subjects
have been followed-up to the study end) be based on imputed outcomes for
subjects who were LTFU (i.e. right-censored with time
|
Details
Implements the Goldilocks design method described in Broglio et al. (2014). At each interim analysis, two probabilities are computed:
-
The posterior predictive probability of eventual success. This is calculated as the proportion of imputed datasets at the current sample size that would go on to be success at the specified threshold. At each interim analysis it is compared to the corresponding element of
Sn
, and if it exceeds the threshold, accrual/enrollment is suspended and the outstanding follow-up allowed to complete before conducting the pre-specified final analysis. -
The posterior predictive probability of final success. This is calculated as the proportion of imputed datasets at the maximum threshold that would go on to be successful. Similar to above, it is compared to the corresponding element of
Fn
, and if it is less than the threshold, accrual/enrollment is suspended and the trial terminated. Typically this would be a binding decision. If it is not a binding decision, then one should also explore the simulations withFn = 0
.
Hence, at each interim analysis look, 3 decisions are allowed:
-
Stop for expected success
-
Stop for futility
-
Continue to enroll new subjects, or if at maximum sample size, proceed to final analysis.
At each interim (and final) analysis methods as:
Log-rank test (
method = "logrank"
). Each (imputed) dataset with both treatment and control arms can be compared using a standard log-rank test. The output is a P-value, and there is no treatment effect reported. The function returns1 - P
, which is reported inpost_prob_ha
. Whilst not a posterior probability, it can be contrasted in the same manner. For example, if the success threshold isP < 0.05
, then one requirespost_prob_ha
> 0.95
. The reason for this is to enable simple switching between Bayesian and frequentist paradigms for analysis.Cox proportional hazards regression Wald test (
method = "cox"
). Similar to the log-rank test, a P-value is calculated based on a two-sided test. However, for consistency,1 - P
, which is reported inpost_prob_ha
. Whilst not a posterior probability, it can be contrasted in the same manner. For example, if the success threshold isP < 0.05
, then one requirespost_prob_ha
> 0.95
.Bayesian absolute difference (
method = "bayes"
). Each imputed dataset is used to update the conjugate Gamma prior (defined byprior
), yielding a posterior distribution for the piecewise exponential rate parameters. In turn, the posterior distribution of the cumulative incidence function (1 - S(t)
, whereS(t)
is the survival function) evaluated at timeend_of_study
is calculated. If a single arm study, then this summarizes the treatment effect, else, if a two-armed study, the independent posteriors are used to estimate the posterior distribution of the difference. A posterior probability is calculated according to the specification of the test type (alternative
) and the value of the null hypothesis (h0
).Chi-square test (
method = "chisq"
). Each (imputed) dataset with both treatment and control arms can be compared using a standard chi-square test on the final event status, which discards the event time information. The output is a P-value, and there is no treatment effect reported. The function returns1 - P
, which is reported inpost_prob_ha
. Whilst not a posterior probability, it can be contrasted in the same manner. For example, if the success threshold isP < 0.05
, then one requirespost_prob_ha
> 0.95
. The reason for this is to enable simple switching between Bayesian and frequentist paradigms for analysis.Imputed final analysis (
imputed_final
). The overall final analysis conducted after accrual is suspended and follow-up is complete can be analyzed on imputed datasets (default) or on the non-imputed dataset. Since the imputations/predictions used during the interim analyses assume all subjects are imputed (since loss to follow-up is not yet known), it would seem most appropriate to conduct the trial in the same manner, especially if loss to follow-up rates are appreciable. Note, this only applies to subjects who are right-censored due to loss to follow-up, which we assume is a non-informative process. This can be used with anymethod
.
Value
A data frame containing some input parameters (arguments) as well as statistics from the analysis, including:
N_treatment:
-
integer. The number of patients enrolled in the treatment arm for each simulation.
N_control:
-
integer. The number of patients enrolled in the control arm for each simulation.
est_interim:
-
scalar. The treatment effect that was estimated at the time of the interim analysis. Note this is not actually used in the final analysis.
est_final:
-
scalar. The treatment effect that was estimated at the final analysis. Final analysis occurs when either the maximum sample size is reached and follow-up complete, or the interim analysis triggered an early stopping of enrollment/accrual and follow-up for those subjects is complete.
post_prob_ha:
-
scalar. The corresponding posterior probability from the final analysis. If
imputed_final
is true, this is calculated as the posterior probability of efficacy (or equivalent, depending on howalternative:
andh0
were specified) for each imputed final analysis dataset, and then averaged over theN_impute
imputations. Ifmethod = "logrank"
,post_prob_ha
is calculated in the same fashion, but value represents1 - P
, whereP
denotes the frequentistP
-value. stop_futility:
-
integer. A logical indicator of whether the trial was stopped early for futility.
stop_expected_success:
-
integer. A logical indicator of whether the trial was stopped early for expected success.
References
Broglio KR, Connor JT, Berry SM. Not too big, not too small: a Goldilocks approach to sample size selection. Journal of Biopharmaceutical Statistics, 2014; 24(3): 685–705.
Examples
# RCT with exponential hazard (no piecewise breaks)
# Note: the number of imputations is small to enable this example to run
# quickly on CRAN tests. In practice, much larger values are needed.
survival_adapt(
hazard_treatment = -log(0.85) / 36,
hazard_control = -log(0.7) / 36,
cutpoints = 0,
N_total = 600,
lambda = 20,
lambda_time = 0,
interim_look = 400,
end_of_study = 36,
prior = c(0.1, 0.1),
block = 2,
rand_ratio = c(1, 1),
prop_loss = 0.30,
alternative = "less",
h0 = 0,
Fn = 0.05,
Sn = 0.9,
prob_ha = 0.975,
N_impute = 10,
N_mcmc = 10,
method = "bayes")