Cox–Snell residual (source code)

= Cox–Snell residual
{c}
{title2=$r_i=\widehat H_i(x_i)$}

A <Cox–Snell residual> is the fitted <cumulative hazard function> evaluated at an observed event or censoring time: $r_i=\widehat H_i(Y_i)$. Its reference <probability distribution> comes from the <probability integral transform>. If the true event time $T_i$ has a proper continuous <survival function> $S_i$, then $H_i=-\log S_i$ satisfies
$$
H_i(T_i)\sim\operatorname{Exp}(1).
$$
For example, an <exponential distribution> with rate $\lambda$ has $H(t)=\lambda t$, so rescaling its event time by $\lambda$ produces a unit-rate <exponential distribution>.

With <right censoring>, $Y_i=\min(T_i,C_i)$ and the transformed observation is $H_i(Y_i)$ together with its original event indicator $\delta_i$. Under <independent censoring>, a <Kaplan–Meier estimator> applied to these transformed observations should approximately follow $e^{-r}$; its <logarithm> should approximately follow a straight line of slope minus one. Censored residuals must remain censored in this comparison.

The exact exponential identity uses the true model, whereas $\widehat H_i$ is estimated from data: fitted residuals are approximate diagnostics and need not be <independent> exact exponentials. Atoms in a discrete event-time <probability distribution>, or a cure fraction with positive <probability> of no finite event, invalidate the unmodified proper-continuous reference law. Such models require diagnostics respecting their jumps or surviving mass.