residuals.coxph(object, type=c("martingale", "deviance", "score", "schoenfeld", "dfbeta", "dfbetas", "scaledsch"), collapse=F, weighted=F)
This is a method for the function residuals for objects inheriting from class "coxph". However, as several types of residuals are available for coxph objects, there is an additional optional argument type.
The score residuals are each individual's contribution to the score vector. Two transformations of this are often more useful: dfbeta is the approximate change in the coefficient vector if that observation were dropped, and dfbetas is the approximate change in the coefficients, scaled by the standard error for the coefficients.
fit <- coxph(Surv(start, stop, event) ~ (age + surgery) * transplant, data=heart) mresid <- resid(fit, collapse=heart$id)