if (FALSE) {
# --------------------------------------------------
# simulate data for illustration
# --------------------------------------------------
set.seed(2021)
n <- 600
time <- rexp(n, rate = log(2) / 20)
event <- sample(round(runif(n, 0, 1)))
accrual_after_ccod <- 1:(n - length(time)) / 30
# --------------------------------------------------
# run bootstrap, for M0 = 3 only, for illustration
# tune parameters for your own example
# --------------------------------------------------
boot1 <- bootstrapTimeToEvent(time, event,
interim.gates = c(330, 350), future.units = 50, n = length(time),
M0 = 3, K0 = 5, alpha = 0.05, accrual = accrual_after_ccod,
seed = 2014)
# median of bootstrap samples:
apply(boot1$event.dates, 2, median)
}
Run the code above in your browser using DataLab