
Schoenfeld residuals and the proportional-hazards test
Source:R/cox_native.R
morie_cox_schoenfeld_residuals.RdOne residual per EVENT (not per subject): the covariate value of the subject who failed, minus the risk-weighted mean over the risk set. Under proportional hazards they have no trend in time, so the correlation with transformed time is a direct test of PH.
Usage
morie_cox_schoenfeld_residuals(fit, transform = c("km", "rank", "identity"))Arguments
- fit
a Cox fit, as for
morie_cox_martingale_residuals.- transform
"km"(1 - Kaplan-Meier, the default),"rank"or"identity".
Details
A significant trend means the hazard ratio moves over follow-up. The response is to stratify on the offending covariate or model it with a time interaction – not to drop it, which changes the question rather than answering it.