Solved – Using quantile in predict for survival

quantilesrsurvival

I am working on survival analysis and fit a model:

srFit <- survreg(formula = Surv(time) ~ f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10, data = train, dist = dist_pred[i_dist])

Then I use the model to predict lifetime of test users:

pred <- predict(srFit, newdata=test, type='quantile', p=c(90 / 100))

But I don't really understand how quantile works. I know the $k^{th}$ quantile for a survival curve $S(t)$ is the location at which a horizontal line at height $p= 1-k$ intersects the plot of $S(t)$ and I know $S(t)$ is a decreasing function showing fraction of surviving members.

So my understanding is when $p=c(0.5)$ median is returned, let's say 20. Does this mean 20 is the point that probability of surviving is 0.5 ?
If I use $p=c(0.9)$ then it will return the point that probability of surviving (ad not failing) is 0.9, right?

Best Answer

Survival regression models are based around a survivor function $S(t)$ which estimates, as a function of time, the proportion of people expected to remain surviving in the sample at that time.

In the documentation for type, interestingly, it says, "a predicted quantile on the original scale of the data "quantile"). So actually, it is predicting failure times. You can verify with a sanity check:

library(survival)
t <- rexp(1000)
fit <- survreg(Surv(t) ~ 1)
predict(fit, type='quantile', p=c(0, .25, .5, 1))[1, ]
quantile(t, c(0, .25, .5, 1)) ## empirical estimate of same values
Related Question