View source: R/data-generation.R
generate_dat | R Documentation |
Generates simulated data
generate_dat( n, X_type, r, ev1_pars, ev2_pars, rate_cens, mech = NULL, eta1 = NULL, p = NULL, mod_type = "latent" )
n |
Sample size. |
X_type |
Either "binary", or "contin" |
r |
Desired correlation between X and Z |
ev1_pars |
Named list of ("a1", "h1_0", "b1", "gamm1") |
ev2_pars |
Named list of ("a2", "h2_0", "b2", "gamm2") |
rate_cens |
Rate of exponential distributiion for censoring. If 0 means no censoring is applied. |
mech |
Missingness mechanism, one of: "MAR_GEN", "MAR", "MNAR", "MCAR" |
eta1 |
Only necessary for mech != "MCAR" - degree/direction of assocation between variable responsible for missingness and probability of missingness |
p |
Proportion of missing values in X |
mod_type |
Either "latent", weibull times generated from separate weibull distribution, or "total", times generated from sum of cause-specific hazards (using inverse transform method). For educational purposes - both methods yield virtually same results. |
Data-frame with missings induced
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.