I am reading a paper where, on the page 13, the authors state that the survival times $T_i$ are generated from a proportional hazards (PH) model with hazard function:

$$\lambda_T(t\mid X_i, W_i)=\exp(\beta X_{i1}+(-0.5-\gamma_1 X_{i2})W_i)\sqrt{t}/2$$

where $W_i$ is the treatment assignment. The censoring times are generated from a Weibull distribution with hazard function $\kappa^\rho$ where $\kappa$ is the scale parameter and $\rho$ is the shape parameter. In the supplementary code for the paper, the survival times are generated as

survival.time <- (-log(runif(n)) / exp(beta * X[ ,1] + (-0.5 - gamma * X[ ,2]) * W))^2

and the censoring times are generated as

    censor.time <- (-log(runif(n)) / (kappa ^ rho)) ^ (1 / rho)

However, the parameterization the authors are using doesn't seem to be consistent with existing approaches for generating survival times from PH models so I'm not sure where these lines of code are coming from. Any ideas?


1 Answer 1


The confusion might come from the multiple parameterizations of the Weibull distribution. Note that the first hazard function can be written in the form $\lambda(t)=\lambda_0(t) \exp(\eta_i)$, where $\eta_i$ is the linear predictor for individual $i$ and $\lambda_0(t)=\sqrt t/2$. With the baseline hazard $\lambda_0(t)$ proportional to a power of $t$, as for a Weibull hazard, that's a proportional-hazards representation of a Weibull survival model. Thus the hazards both for the survival and for the censoring are based on Weibull models.

In the parameterization used in the Austin paper you cite, the Weibull cumulative hazard is represented as $H_0(t)=\lambda t^{\nu}$ and you simulate a Weibull-distributed survival time $T$ by sampling $u$ from a uniform distribution of survival fractions over (0,1) and calculating:

$$T = \left(-\frac{\log u}{\lambda \exp (\eta)} \right)^{1/\nu} .$$

That comes from the general relationship between the survival function $S(t)$ and the cumulative hazard function, $S(t)=\exp(-H(t))$. Both examples of simulation code that you show are in that general form for simulation from a Weibull survival model, although I can't rule out some discrepancies in the translation from page 13 of the arXiv paper to the supplementary code arising from the differing parameterizations.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.