Schoenfeld residual (source code)

= Schoenfeld residual
{c}
{title2=$s_j=x_{i_j}-\frac{\sum_{i\in R_j}x_i e^{x_i^T\widehat\beta}}{\sum_{i\in R_j}e^{x_i^T\widehat\beta}}$}

At an untied event time, a Schoenfeld residual is the event subject's covariate vector minus its fitted risk-weighted average over the <risk set>. Under a correctly specified <Cox proportional-hazards model>, these residuals have no systematic mean trend with event time. They are defined at event times, unlike <Cox–Snell residuals> which can be evaluated at both events and censoring times.