# What is the difference between the different types of residuals in survival analysis (Cox regression)?

I am fairly new to survival analysis. I was advised to look up and learn Schoenfeld residuals as part of a model diagnosis to see if the proportional hazard assumption has been satisfied. Whilst looking this up I've seen references to many different types of residuals including:

• Cox-Snell
• Deviance
• Martingale
• Score
• Schoenfeld

What are the differences between these residuals and when is it recommended to use one over another? (I am happy for answers which are simply links to papers to go read.)

Cox-Snell residuals $$r_{Ci}$$, are used to assess a model's goodness-of-fit. By plotting the Cox-Snell residual against the cumulative hazard function a model's fit can be assessed. A well fitting model will exhibit a linear line through the origin with a unit gradient. It should be noted that it will take a particularly ill-fitting model for the Cox-Snell residuals to deviate significantly from this. It is also not uncommon to see some slight jumps occurring at the extremities of the graph. One criticism of Cox-Snell residuals is that they do not account for censored observations, therefore the adjusted Cox-Snell residuals were devised by Crowley & Hu (1977) whereby the standard Cox-Snell residual, $$r_{Ci}$$ could be used for uncensored observations and $$r_{Ci} + \Delta$$ whereby $$\Delta = \log (2) = 0.693$$, is used to adjust the residual.
Martingale residuals $$r_{Mi}$$ can be defined as $$r_{Mi} = \delta_i - r_{Ci}$$ where $$\delta_i$$ is a switch taking the value 0 if observation $$i$$ is censored and 1 if observation $$i$$ is uncensored. Martingale residuals take a value between $$[1, - \infty]$$ for uncensored observations and $$[0,- \infty]$$ for censored observations. Martingale residuals can be used to assess the true functional form of a particular covariate (Thernau et al. (1990)). It is often useful to overlay a LOESS curve over this plot as they can be noisy in plots with lots of observations. Martingale residuals can also be used to assess outliers in the data set whereby the survivor function predicts an event either too early or too late, however, it's often better to use the deviance residual for this.
A deviance residual, $$r_{Di} = sgn(r_{Mi})\sqrt{-2 r_{Mi} + \delta_i \log{(\delta_i-r_{Mi})}}$$ where the $$sgn$$ takes a value of 1 for positive martingale residuals and -1 for a negative martingale residual. A residual of high absolute value is indicative of an outlier. A positively valued deviance residual is indicative of an observation whereby the event occurred sooner than predicted; the converse is true for negatively valued residual. Unlike Martingale residuals, deviance residuals are mean centered around 0, making them significantly easier to interpret than Martingale residuals when looking for outliers. One application of deviance residuals is to jackknife the dataset with just one parameter modeled and test for significant difference in parameter coefficients as each observation are removed. A significant change would indicate a highly influential observation.
• 1. Cox-Snell residuals are plotted as: $\hat{H}(r_{C_{i}})$ vs $r_{C_{i}}$, or: $\log[\hat{H}(r_{C_{i}})]$ vs $\log[r_{C_{i}}]$ 2. The deviance residuals formula needs a little tweaking: $r_{D_{i}}={\rm sgn}(r_{M_{i}})\sqrt{−2[r_{M_{i}}+\delta_{i}\log(\delta_{i}−r_{M_{i}})]}$ 3. Additionally, look here.