# \donttest{
# generate the design matrix and append the true summary statistics
condition <- merge(
assumptions_delayed_effect(),
design_fixed_followup(),
by=NULL
) |>
tail(4) |>
head(1) |>
true_summary_statistics_delayed_effect(cutoff_stats = 15)
# create some summarise functions
summarise_all <- create_summarise_function(
coxph=summarise_estimator(hr, gAHR_15, hr_lower, hr_upper, name="gAHR"),
coxph=summarise_estimator(hr, hazard_trt/hazard_ctrl, hr_lower, hr_upper, name="HR"),
coxph=summarise_estimator(hr, NA_real_, name="NA")
)
# runs simulations
sim_results <- runSimulation(
design=condition,
replications=10,
generate=generate_delayed_effect,
analyse=list(
coxph=analyse_coxph()
),
summarise = summarise_all
)
# mse is missing for the summarise function in which the real value was NA
sim_results[, names(sim_results) |> grepl(pattern="\\.mse$")]
# but the standard deviation can be estimated in all cases
sim_results[, names(sim_results) |> grepl(pattern="\\.sd_est$")]
# }
Run the code above in your browser using DataLab