# residuals in parametric survival analysis

This is probably a straight-forward question but I can't find a straight-forward answer. The topic is new to me.

I am performing parametric survival analysis, e.g. estimating a survival function from survival data and some covariates.

It seems like it would be intuitive to check the residuals of the model in the same was as linear regression, ie per subject, subtract the mean survival time estimated from the model from the actual survival time (and square and sum the results, for example).

But I do not see this anywhere as a recommended procedure. I can see that with censoring you would not be able to do this too well (ie, there is no "actual" survival time for these individuals), but if there is no censoring? Or to compare competing parametric survival models on the same data?

Why is this not done? Or is it done and I am just not finding it?

Edit: I am editing the question because it seems it is unclear (the "duplicate" question is not the same as mine). My question is essentially, why does one not use, the "sum of the absolute difference in predicted survival time vs actual survival time" from parametric models of survival data (where the predicted survival time is the median/mean survival time given the covariates) to compare models? It seems the model with the smaller sum of residuals would be better.

Thank you!

• Does this answer your question? Cox Snell residuals in R You can calculate residuals and check their fit against the assumed parametric form, in a way that takes into account censoring. Also see this page and Chapter 18 of Frank Harrell's course notes or book.
– EdM
Mar 6 at 14:09
• Thank you, @EdM! If I understand, you can use standardized residuals to visually assess model fit. But I am looking for a numerical comparison of competing models (other than AIC). From the page, you write "... examine which model has the best predictive performance, ... evaluating the competing models ..." How does one "evaluate the competing models", ie what is "best predictive performance"? I thought sums of (standardized) residuals could work. Is that what you had in mind? Mar 6 at 14:33
• "My question is essentially, why does one not use, the "sum of the absolute difference in predicted survival time vs actual survival time" from parametric models of survival data (where the predicted survival time is the median/mean survival time given the covariates) to compare models' Isn't this what they do in the duplicate question? Mar 6 at 17:42
• @SextusEmpiricus Thanks for the response! I don't think (?) that is what they are doing. They seem to to be visually comparing the empirical cumulative hazard to a theoretical exponential distribution. My question (probably a naive one) is why one does not simply use the sum (taken over all non-censored data points) of the differences between the actual survival time and the predicted survival (mean or median survival time of the generated conditional parametric model) as a quantitative measure of model fit to compare to other similar parametric models on the same data? Mar 7 at 12:09
• @Rorio I believe that you are right. After reading into it, it seems to me that the Cox Snell residuals are actually a departure from the idea that you suggest. You suggest to compare a model like $$Y_i = f(\beta,X_i)+ \epsilon_i$$ and the residuals $r_i$ are found by solving $$Y_i = f(\hat\beta,X_i) + r_i$$ And for Cox Snell residuals this is generalized to the error-terms (and related residuals) being incorporated into the model via a more general formula rather just an additional model $$Y_i = f(\beta,X_i, \epsilon_i)$$ and the residuals are the solution to $$Y_i = f(\hat\beta,X_i,r_i)$$ Mar 7 at 12:34

The residuals.survreg() function in the R survival package allows for 9 different types of residuals. The default "response" residuals, the differences between observed and predicted survival times, are what you seem to have in mind.

If there are no censored observation times, then you can certainly can use such residuals to evaluate models. Then a survival model is just a particular type of parametric model. For some parametric forms it might be better to evaluate residuals in a corresponding transformed scale, as illustrated in this answer, but the basic idea of using residuals between predictions and observations, of some form, to evaluate models is OK if there's no censoring.

Censoring is an issue for most survival models in practice, however, and there's no reliable way to evaluate residuals for censored observations. You suggest avoiding that problem by restricting analysis of such residuals to uncensored observations. The problem is that you are then throwing away the information provided by the censored observations, which do contribute to the likelihood calculations.

The principles explained in this post might be of interest. Censored observations make evaluation of explained variation in outcomes unreliable. Likelihood-based methods like AIC take into account all of the observations and thus provide the most efficient and reliable use of the data to evaluate models.

• Thank you @EdM! This is essentially the information I was trying to figure out. Mar 13 at 14:42

Survival times are sometimes modelled as

$$Y_i = e^{\beta X_i} \cdot \epsilon_i$$

where the $$\epsilon_i$$ are exponential distributed. The term $$e^{\beta X_i}$$ relates to the risk and increases or decreases the mortality rate.

Cox Snell residuals are in this case defined as the solution to

$$Y_i = e^{\hat\beta X_i} \cdot r_i$$

In a way you can relate this to your idea, of differencing the estimates with the actual observations, when you use the logarithm of the survival times.

$$\log(Y_i) = {\hat\beta X_i} + \log(r_i)$$

And

$$\log(r_i) = \log(Y_i) - \log(\hat{Y}_i)$$

where the log-residuals $$\log(r_i)$$ follow a Gumbel distribution.

• Thank you @Sextus Empiricus! This is very useful information when considering the information from EdM as well. Mar 13 at 14:44