Learn R Programming

rEHR (version 1.0)

surv_sims: Function to simulate survival data.

Description

Model: proportional hazards, h(t; cov_mat, beta) = exp(cov_mat indicators for Type I censoring (common censoring time 'tc').

Usage

surv_sims(cov_mat, beta, cens_type = c("typeI", "noninformative"), baseline_hazard, cens_hazard = 0.04, cens_prob = 0, scale = 1, weibull_shape = 1)

Arguments

cov_mat
n x p matrix of cov_matiates
beta
p-vector of regression coefficients
cens_type
typeI censoring or non-informative based on exponential distribution
baseline_hazard
for modelling death dates
cens_hazard
log(hazard) for non-informative censoring
cens_prob
expected censoring fraction (0
scale
value to scale up the time variable by
weibull_shape
shape parameter for the weibull distribution. 1 is the same as an exponential

Value

Censored exponential survival times and censoring

Details

Weibull_shape is the k (shape) parameter from a weibull distribution
  • A value of k < 1 indicates that the mortality rate decreases over time. This happens if there is significant infant mortality
  • A value of k = 1 indicates that the mortality rate is constant over time. This might suggest random external events are causing mortality. This is the same as an exponential distribution
  • A value of k > 1 indicates that the mortality rate increases with time. This happens if there is an aging process.