Research methods guide
How to check proportional hazards in a Cox model
Use plots of scaled Schoenfeld residuals over time together with term-level and global tests to assess proportional hazards in a Cox model. Interpret them in context of the model, follow-up, and events.
A single Cox HR across follow-up warrants a check for time-varying effects. The R commands assume verified time, event, and covariate columns.
Three outputs for checking a Cox model
Use follow-up days, a verified 0/1 event indicator, and baseline exposure.
| Item | Worked example | Verification |
|---|---|---|
| Fit the model | fit <- survival::coxph(survival::Surv(days, event) ~ exposure + age, data = d, x = TRUE) | Verify origin, event coding, analysis rows, event count, and censoring. |
| Test and plot | z <- survival::cox.zph(fit); print(z); plot(z, var = "exposure"). | Review the exposure term, global test, and time trend. Check how many late events support it. |
| Handling and reporting | If early and late HRs differ, document the apparent time variation and check prespecified windows. | Consider a time-varying coefficient for the exposure of interest or stratification for appropriate adjustment variables. |
Apply the method to your materials
Verify follow-up data first
Check time units, delayed entry, follow-up ranges, and risk sets. Use the appropriate start–stop representation when required.
Save a reproducible record
Save the formula, diagnostic options, term and global outputs, plots, and decision. Explain how any revised estimand answers the question.
Questions that arise in practice
Does global P>0.05 establish proportional hazards?
Report whether the diagnostics found clear evidence of violation and describe the plot. Sparse events can limit diagnostic precision.
Verified sources
The official sources below were checked on 2026-11-12. Access conditions and update dates are rechecked before publication.
RigorMed workspace
Start with your research materials
Bring your research question, available materials, and the steps you want to check.
