2
$\begingroup$

Can you calculate the time at set risk from proportional hazard models?

Say I've got my model built for the whole population. The risk of developing an event in one year is 5%. After stratification, some patients have a higher risk, some lower.

How do I get a value, per patient, that will tell me the time at which they have a 5% risk of developing an event?

Apologies for not showing any code examples, I'm wondering if this is even possible. if it isn't, could you suggest other models?

$\endgroup$

1 Answer 1

1
$\begingroup$

You can think about this as a generalization of median survival, which is the (frequently reported) time when the probability of having experienced an event is 0.5. You can in principle ask for any quantile of a survival function from a model.

The time to 0.05 probability of having an event that you seek represents the time to 0.95 probability of survival. Depending on the software you might need to specify either 0.05 or 0.95 as the probability, so check the manual first. With the R quantile() method for survival curves produced by the survfit() function,

the argument prob of this function applies to the cumulative distribution function $F(t) = 1-S(t)$.

Thus you would specify probs = 0.05 with that software. The help page has an example of how to specify sets of covariate values and associated survival quantiles, along with confidence intervals, from a Cox model. That help page also describes the considerations when the desired survival probability coincides with a flat portion of the survival curve.

$\endgroup$
2
  • $\begingroup$ Thanks for the reply! Could you explain, in as layman terms as possible, how the quantile function actually does this? and is this how you mean the code to look?: f1 <- survfit(Surv(time, status) ~ sex, data = lung) quantile(f1, probs =c(0.22,0.33))This is fine, but is there a way where I run a "predict"-like function that takes patient variables and outputs the prediction? $\endgroup$
    – Wojty
    Commented May 13, 2022 at 11:12
  • $\begingroup$ @WojciechBanaś your formula is not for a Cox model; that's just for a standard Kaplan-Meier plot. To account for covariates you first fit a model with coxph(), then call survfit() on the Cox model with a newdata argument specifying the desired covariate values. See the help page for survfit.coxph. The quantile.survfit help page has an example of this 3-step process at the bottom. $\endgroup$
    – EdM
    Commented May 13, 2022 at 12:19

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.