sim_adtte.Rd
This function simulates survival data with correlated time to progression and overall survival times. Optionally crossover from treatment arms can be simulated.
sim_adtte(
rc_siminfo = FALSE,
rc_origos = FALSE,
id = 1,
seed = 1234,
rho = 0,
pswitch = 0,
proppd = 0,
beta_1a = log(0.7),
beta_1b = log(0.7),
beta_2a = log(0.7),
beta_2b = log(0.7),
beta_pd = log(0.4),
arm_n = 250,
enroll_start = 0,
enroll_end = 1,
admin_censor = 2,
os_gamma = 1.2,
os_lambda = 0.3,
ttp_gamma = 1.5,
ttp_lambda = 2
)
Should simulation params be included in simulated dataframe (logical). Defaults to FALSE.
Should OS without switching be included in simulated dataframe (logical). Defaults to FALSE.
Identifer added to simulated dataframe. Defaults to 1.
Seed used for random number generator. Defaults to 1234.
correlation coefficient between TTP and OS. Defaults to 0.
proportion of patients who switch. Defaults to 0.
proportion of patients with PFS before switch allowed. Defaults to 0.
treatment effect (as log(Hazard Ratio)) for OS pre PFS. Defaults to log(0.7).
treatment effect (as log(Hazard Ratio)) for OS post PFS. Defaults to log(0.7).
treatment effect (as log(Hazard Ratio)) for OS pre PFS (switch). Defaults to log(0.7).
treatment effect (as log(Hazard Ratio)) for OS post PFS (switch). Defaults to log(0.7).
treatment effect on progression (as log(HR)). Defaults to log(0.4).
patients per arm. Defaults to 250.
start of enrollment. Defaults to 0.
end of enrollment. Defaults to 1.
end of trial. Defaults to 2.
weibull shape - for OS. Defaults to 1.2.
weibull scale - for OS. Defaults to 0.3.
weibull shape - for TTP. Defaults to 1.5.
weibull scale - for TTP. Defaults to 2.
The simulation times are derived from formulas in Austin 2012 adapted to enable correlations between endpoints. Austin, P.C. (2012), Generating survival times to simulate Cox proportional hazards models with time‐varying covariates. Statist. Med., 31: 3946-3958. https://doi.org/10.1002/sim.5452
require(survival)
require(dplyr)
#> Loading required package: dplyr
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
ADTTE <- sim_adtte()
survfit(Surv(AVAL, event = CNSR == 0) ~ ARM, data = filter(ADTTE, PARAMCD == "PFS")) %>%
plot()
survfit(Surv(AVAL, event = CNSR == 0) ~ ARM, data = filter(ADTTE, PARAMCD == "OS")) %>%
plot()