generate_dat: Generates simulated data

View source: R/data-generation.R

generate_datR Documentation

Generates simulated data

Description

Generates simulated data

Usage

generate_dat(
  n,
  X_type,
  r,
  ev1_pars,
  ev2_pars,
  rate_cens,
  mech = NULL,
  eta1 = NULL,
  p = NULL,
  mod_type = "latent"
)

Arguments

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.

Value

Data-frame with missings induced


survival-lumc/CauseSpecCovarMI documentation built on June 16, 2022, 9:51 a.m.