View source: R/gen_surv_times.R
gen_surv_times | R Documentation |
Generate survival times according to hazard rate
h(t) \exp(\mu)
with h(t)
the hazard rate associated with the
specified inverse cumulative hazard rate invchaz
and \mu
the
specified true hazard ratio mu
. See Bender et al. (2005).
gen_surv_times(invchaz, mu = log(1), data, coxphmod = NULL)
invchaz |
the inverse cumulative (baseline) hazard rate to be used for generating survival times. Must take vector inputs! |
mu |
the true hazard ratio used to generate survival times. |
data |
an integer number of survival times to generate or
(in combination with coxphmod): a |
coxphmod |
(optional) a cox proportional hazards regression model as produced by
the function
|
Sometimes it is desirable to generate survival times from an increased hazard rate
h(t, \mu) = h_0(t) e^\mu
with h_0
the baseline hazard rate. We call e^\mu
the true hazard ratio.
A vector of survival times from subject entry time.
Daniel Gomon
Bender, R., Augustin, T., & Blettner, M. (2005). Generating survival times to simulate Cox proportional hazards models. Statistics in Medicine, 24(11), 1713-1723. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.2059")}
set.seed(123)
gen_surv_times(invchaz = function(t) inv_chaz_exp(t, lambda = 0.01), data = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.