powered by
This combines the covariates simulation via simul_covariates() with 10 categorical covariates, and the PFS simulation via simul_pfs().
simul_covariates()
simul_pfs()
simul_data(n, add_interaction = FALSE, coefs, ...)
A combined data.frame with the id column, the design matrix and the PFS outcomes.
data.frame
id
(count) number of patients.
count
(flag) whether to add interaction terms between covariates 1 and 2.
flag
(numeric) named vector of coefficients to set.
numeric
additional parameters apart from the linear predictor values needed for simul_pfs().
Regression coefficients are for an AFT with over-parametrized dummy coding for arm-subgroup interactions.
set.seed(321) simul_data( n = 100, coefs = c(arm1 = 1), sigma_aft = 1, recr_duration = 0.2, rate_cens = 2, n_events = 20 )
Run the code above in your browser using DataLab