Cox Proportional Hazards Model Data Generation From Weibull Distribution
Source:R/dataCox.R
dataCox.RdFunction dataCox generaters random survivaldata from Weibull
distribution (with parameters lambda and rho for given input
x data, model coefficients beta and censoring rate for censoring
that comes from exponential distribution with parameter cens.rate.
Arguments
- n
Number of observations to generate.
- lambda
lambda parameter for Weibull distribution.
- rho
rho parameter for Weibull distribution.
- x
A data.frame with an input data to generate the survival times for.
- beta
True model coefficients.
- cens.rate
Parameter for exponential distribution, which is responsible for censoring.
Value
A data.frame containing columns:
idan integer.timesurvival times.statusobservation status (event occured (1) or not (0)).xadata.framewith an input data to generate the survival times for.
Details
For each observation true survival time is generated and a censroing time. If censoring time is less then survival time, then the survival time
is returned and a status of observations is set to 0 which means the
observation had censored time. If the survival time is less than censoring
time, then for this observation the true survival time is returned and the
status of this observation is set to 1 which means that the event has
been noticed.
References
http://onlinelibrary.wiley.com/doi/10.1002/sim.2059/abstract
Generating survival times to simulate Cox proportional hazards models, 2005 by Ralf Bender, Thomas Augustin, Maria Blettner.