Loading [MathJax]/jax/output/CommonHTML/jax.js
Skip to content

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)=1exp(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 UUni[0,1]. Moreover, if UUni[0,1], then (1U)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=H10[log(U)λi] with: λi=αexp(xiω), UUni[0,1] and ZNormal(0,1)

Therefore, as long as it is possible to compute H10, we can generate random survival times.

  • Exponential: Ti=log(U)λi
  • Weibull : Ti=(log(U)λi)1/β
  • Gompertz : Ti=1βlog(1βlog(U)λi)
  • Log-Logistic : Ti=1λi(U1U)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.

References