Generating random survival times
Simulation studies represent an important statistical tool to investigate the performance, properties and adequacy of statistical models. Here, we will see how to generate random survival times based on the most commonly used distributions:
- Exponential
- Weibull
- Gompertz
- Log-Logistic
- Lognormal
Distribution function of the Cox model
Thanks to the Cox proportional hazard model, it is convenient to model survival times through the hazard function, with h0(t) the baseline function: h(t,xi)=h0(t)exp(→xi⋅→ω)
The survival function of the Cox proportional hazards models given by S(t,xi)=exp(−H0(t)⋅exp(→xi⋅→ω)) with H0(t)=∫t0h(u)du
And thus, the distribution function of the Cox model is F(t,xi)=1−exp(−H0(t)⋅exp(→xi⋅→ω))
Random survival times formula
Let Y be a random variable with distribution function F, then U=F(Y) follows a uniform distribution on the interval [0,1], abbreviated as U∼Uni[0,1]. Moreover, if U∼Uni[0,1], then (1−U)∼Uni[0,1], too. Thus, U=exp(−H0(t)⋅exp(→xi⋅→ω))∼Uni[0,1]
Therefore, the survival time T of the Cox model can be expressed as Ti=H−10[−log(U)λi] with: λi=αexp(→xi⋅→ω), U∼Uni[0,1] and Z∼Normal(0,1)
Therefore, as long as it is possible to compute H−10, we can generate random survival times.
Exponential
: Ti=−log(U)λiWeibull
: Ti=(−log(U)λi)1/βGompertz
: Ti=1βlog(1−βlog(U)λi)Log-Logistic
: Ti=1λi(U1−U)1/βLog-Normal
: Ti=λiexp(βZ)
α and β are tuning parameters.
Linear and Nonlinear hazard function
It is possible to use nonlinear hazard functions to generate random survival times such that: h(t,xi)=h0(t)exp(ψ(→xi⋅→ω)) where ψ is a nonlinear function.