composite event generator for simulation, this simulator is constructed based on Mao. L(2015), it assumes constant baseline hazard.
Arguments
- n_patients
number of patients
- n_vars
number of covariates
- vars_cate
vector of "continuous", "binary"
- true_beta
True parameters
- non_linear_hazard
whether to use non-linear hazard function
- non_linear_function
the non-linear function to generate hazard
- sigma_scale_gamma
variance of frailty term
- seed
seed for random number generation
- s
number of events one patient can up to have, default is 2000
Examples
# example code
if (FALSE) { # \dontrun{
library(doParallel)
registerDoParallel(cores = 16)
rst <- foreach(i = 1:48) %dopar%{
data_list <- compo_sim_mao(
n_patients = 200,
seed = i
)
library(dplyr)
df_train <- manual_censoring(data_list[[1]], 0.8)
estimate_list <- wcompo_est(
data = df_train,
weight = c(1, 1)
)
estimate_list$beta
}
df_rst <- t(do.call("cbind", rst))
colMeans(df_rst)
boxplot(df_rst)
} # }