Simulate data from a single two-arm trial with an exponentially distributed time-to-event endpoint and one predictor of the intercurrent event
Source:R/sim_dat_one_trial_exp_covar.R
sim_dat_one_trial_exp_covar.Rd
Simulate data from a single two-arm trial with an exponentially distributed time-to-event endpoint and one predictor of the intercurrent event
Usage
sim_dat_one_trial_exp_covar(
n,
nt,
prob_X1,
prob_ice_X1,
prob_ice_X0,
fu_max,
prop_cens = 0,
T0T_rate,
T0N_rate,
T1T_rate,
T1N_rate
)
Arguments
- n
Positive integer value, number of subjects in the trial.
- nt
Positive integer value, number of treated subjects.
- prob_X1
Numeric value on the interval \((0,1)\), probability of being at high risk of experiencing the intercurrent event of interest when treated (i.e. the event that determines the principal stratum membership).
- prob_ice_X1
Numeric value on the interval \((0,1)\), probability of the intercurrent event of interest if treated and at high risk of the intercurrent event.
- prob_ice_X0
Numeric value on the interval \((0,1)\), probability of the intercurrent event of interest if treated and not at high risk of the intercurrent event.
- fu_max
Positive integer value, maximum follow-up time in days (administrative censoring assumed afterwards).
- prop_cens
Numeric value on the interval \([0,1)\), proportion of uniformly censored patients (default is 0).
- T0T_rate
Positive numeric value, monthly event rate in control subjects that would develop the intercurrent event if treated.
- T0N_rate
Positive numeric value, monthly event rate in control subjects that never develop the intercurrent event.
- T1T_rate
Positive numeric value, monthly event rate in treated subjects that develop the intercurrent event.
- T1N_rate
Positive numeric value, monthly event rate in treated subjects that never develop the intercurrent event.
Examples
d_params_covar <- list(
n = 1000,
nt = 500,
prob_X1 = 0.4,
prob_ice_X1 = 0.5,
prob_ice_X0 = 0.2,
fu_max = 48*7,
prop_cens = 0.15,
T0T_rate = 0.2,
T0N_rate = 0.2,
T1T_rate = 0.15,
T1N_rate = 0.1
)
dat_single_trial <- sim_dat_one_trial_exp_covar(
n = d_params_covar[["n"]],
nt = d_params_covar[["nt"]],
prob_X1 = d_params_covar[["prob_X1"]],
prob_ice_X1 = d_params_covar[["prob_ice_X1"]],
prob_ice_X0 = d_params_covar[["prob_ice_X0"]],
fu_max = d_params_covar[["fu_max"]],
prop_cens = d_params_covar[["prop_cens"]],
T0T_rate = d_params_covar[["T0T_rate"]],
T0N_rate = d_params_covar[["T0N_rate"]],
T1T_rate = d_params_covar[["T1T_rate"]],
T1N_rate = d_params_covar[["T1N_rate"]]
)
dim(dat_single_trial)
head(dat_single_trial)