← All resources

Cox Model Assumptions: What to Check and How to Report

12 min read
Cox Model Assumptions: What to Check and How to Report

Cox Model Assumptions: What to Check and How to Report

Cox model diagnostic plots on a research table

The Cox model rests on four assumptions: hazard ratios that stay constant over time, a linear relationship between each continuous covariate and the log-hazard, covariates that do not change over time, and censoring that is unrelated to the outcome. The proportional hazards assumption is the one reviewers ask about most, and the one most often left unchecked. This guide shows what each assumption means, how to test it with Schoenfeld residuals and related diagnostics, and what to write in your methods section when a check fails. Checking and documenting these steps is a multi-step job, and it is the kind of work we built PlotStudio AI for as agentic analytics for researchers.

Plotstudio
plotstudio.ai
Make Cox Diagnostics Reproducible
PlotStudio AI plans, runs, inspects, and documents research analyses, with methods, code, and outputs available for review.
Visit

TL;DR

Table of Contents

What the Cox model actually assumes

The Cox model (Cox, 1972) writes each person’s hazard as a baseline hazard multiplied by exp(β’x). The baseline hazard h₀(t) is left completely unspecified. Because it cancels when you compare two people, the hazard ratio does not depend on time. That is why it is called a proportional-hazards model.

In practice that gives you four things to defend:

Assumption Plain meaning Typical check
Proportional hazards A covariate’s hazard ratio is the same at 3 months and at 3 years Schoenfeld residuals, log-log curves
Linearity Each unit of a continuous covariate shifts the log-hazard by the same amount Martingale residuals, splines
Time-independent covariates Covariate values are fixed at baseline Study design, time-varying extension
Noninformative censoring Being censored says nothing about future risk, given covariates Design review, sensitivity analysis

Schober and Vetter list these assumptions in a clinical overview, and Stanford’s lecture notes add that the true event time must not depend on the censoring time. If censoring is new to you, our guide to censoring in survival analysis covers the types.

What proportional hazards means in a real study

A hazard ratio of 0.7 for treatment versus placebo sounds like a constant 30% reduction at every moment. Under PH, that is exactly what it is. When PH fails, Stensrud and Hernán point out that it can only be read as an average effect over follow-up.

The consequences are concrete:

The same review notes that an earlier survey found most cancer studies using Cox models did not report checking PH. A reviewer who asks you to justify the method is asking about exactly this gap. For a refresher on the quantity itself, see hazard ratios explained.

How to test the proportional hazards assumption

There are three standard checks. Use more than one.

Three checks for the proportional hazards assumption

Schoenfeld residuals and cox.zph

For each event, a Schoenfeld residual is the difference between the covariate value of the person who had the event and the risk-weighted expected value among those still at risk. Under PH, scaled residuals plotted against time look like random scatter around zero.

In R, cox.zph(fit) does this for each covariate. It correlates scaled Schoenfeld residuals with a transformation of time (Kaplan-Meier by default) and adds a global test. The output table gives a score test, degrees of freedom and two-sided p-value per term. The null hypothesis is that the correlation with time is zero. The simplified recipe is also described by Emmert-Streib and Dehmer: fit the model, take the residuals, rank the event times and test the correlation.

library(survival)
fit <- coxph(Surv(time, status) ~ age + sex + treatment, data = d)
zph <- cox.zph(fit)
print(zph)
plot(zph)

Log-log curves for categorical predictors

For a grouping variable, plot log(-log(survival)) against log time for each group. Under PH the curves are approximately parallel and do not cross. With few events, curves wobble, so judge the overall pattern.

Time interaction terms

Add a covariate-by-time term and test its coefficient. This is equivalent in spirit to the score test and is useful when you want an explicit estimate of how the effect drifts.

Reading Schoenfeld residual plots and p-values

The cox.zph plot shows an estimate of the time-dependent coefficient β(t). If PH holds, that line is horizontal. A steady slope or a U-shape suggests the effect changes over follow-up.

A worked example from Fox and Weisberg’s recidivism data: age gave a chi-square of 6.33 and p = 0.012, evidence against PH for that variable, while the global test on 3 degrees of freedom gave p = 0.068. Two lessons follow:

  1. The global test can miss a problem in a single covariate, so read the per-variable rows.
  2. A p-value alone does not tell you how large the departure is. Look at the curve, and ask whether the change in β(t) would alter your clinical conclusion.

Sample size matters in both directions. In a registry with thousands of events, tiny wiggles reach p < 0.05. In a 60-patient trial, a p of 0.4 may only mean the test had little power. Stensrud and Hernán go further and argue that PH tests are unnecessary when variation in the hazard ratio is expected anyway, and that the question is how to interpret the effect. Schober and Vetter note the importance of the assumption is debated, yet still recommend assessing it because violations are sometimes fixable. A sound approach is to do both: test, plot and interpret.

Other Cox diagnostics worth running

Functional form. Plot martingale residuals against each continuous covariate, or use component-plus-residual plots, to detect nonlinearity in the log-hazard relationship. If age or a biomarker bends, model it with splines or a transformation.

Influential observations. Use dfbeta residuals to see which patients move a coefficient. One extreme biomarker value can drive a result.

Cumulative martingale residuals. Lin and Wei proposed cumulative sums of martingale-based residuals for covariate form, the link function and PH, with an omnibus test. Because raw residual plots are hard to judge by eye, they compare the observed process with simulated ones from the null distribution.

Censoring. Noninformative censoring cannot be tested from the data alone. You argue it from design: why people left, whether dropout relates to prognosis, and whether a sensitivity analysis changes the answer.

Independence. Repeated events per person, or patients clustered in hospitals, need robust standard errors, frailty terms or a stratified design.

Other Cox diagnostics worth running

What to do when proportional hazards fails

One guideline in the clinical literature says that if PH is invalid, the Cox model should not be used as it stands and the usual fixes are a stratified model or time-varying covariates. In practice:

  1. Stratify on the offending categorical variable. Each stratum gets its own baseline hazard, but you lose a hazard ratio for that variable.
  2. Model a time-varying effect, for example splitting follow-up at a clinically meaningful time or adding a smooth function of time. Interpretation is harder, and these extensions are prone to misspecification.
  3. Change the estimand. Report restricted mean survival time or an absolute risk difference alongside, or use bootstrapping and inverse probability weighting, which address the variance and censoring-distribution problems Stensrud and Hernán describe.
  4. Keep the Cox model if you are predicting. A Monte Carlo study found PH violation had negligible impact on calibration of Cox predictions, though that does not rescue the interpretation of a single hazard ratio.

Whatever you choose, write down the test, the plot, the decision and the alternative you tried. For code walk-throughs, see our guides to survival analysis in R and Cox regression, and the proportional hazards tag for more.

A reporting checklist for your methods section

  • State the model, covariates and how continuous variables were coded.
  • Report the PH test used (for example, cox.zph in survival version and software named), both global and per-covariate results.
  • Show or cite the Schoenfeld plot for any covariate that failed.
  • Describe the functional-form check and any splines.
  • State the censoring mechanism and your argument for noninformative censoring.
  • Describe the remedy (stratification, time-varying term, alternative estimand) and show the main result both ways if the conclusion could change.

Where PlotStudio AI fits

R, Python, Stata, SPSS, SAS and Jupyter give you the statistical computing. PlotStudio AI adds an agentic layer on top: it plans the investigation, writes and runs real code, inspects intermediate results and documents the analysis. It does not replace those tools. For Cox diagnostics that means a multi-step job, from fitting the model to residual checks to a written record, rather than a one-shot answer.

Plan Mode lets you review and change the proposed approach, including methods and assumptions, before anything runs. Analyses can run locally on your machine, which suits clinical datasets that cannot go to a conventional cloud platform. Completed work is kept as searchable Analysis Pages and can be exported as notebooks or PDF reports, so a supervisor or reviewer can see how each number was produced. PlotStudio AI supports survival analysis and Cox proportional hazards models, and Skills let a lab encode its own statistical conventions and reporting expectations.

If you are looking for a Julius AI alternative, the better Julius AI alternative is PlotStudio AI for researchers who need reproducible, multi-step analysis rather than one-shot chat.

PlotStudio AI has a free trial. Bring Your Own Key is $39.99 per month, or $399.90 per year on the academic page, and Managed Credits is $69.99 per month. Start from the pricing page.

Plotstudio

Perspective

Most Cox analyses that fail review do not fail on the model. They fail on the paper trail. The reviewer asks how proportional hazards was checked, the supervisor cannot rerun the numbers, and the answer lives in a script nobody can find.

We built PlotStudio AI as agentic analytics for researchers because a diagnostic is a sequence, not a click: fit, test, plot, judge, adjust, refit, report. An agent that plans that sequence, lets you approve it in Plan Mode, runs real code and keeps the methodology, statistics and charts together is, in our view, an emerging must-have layer in the modern research toolkit. It sits beside R and Python, not instead of them. They compute. It plans, executes, inspects, validates and documents.

The statistics still need your judgment. Whether a slope in β(t) matters clinically is your call. What we can do is make sure every step that led to it is on the page.

Aymen

FAQ

What is the proportional hazards assumption in simple terms?

It means the ratio of hazards between any two groups or covariate values stays the same throughout follow-up. If a treatment halves the hazard at month 2, it must also halve it at month 20. When the ratio drifts, one hazard ratio can only describe an average over the study.

Which test checks the Cox proportional hazards assumption?

The most common is the Schoenfeld residual test, run with cox.zph in R’s survival package. It tests whether scaled residuals correlate with time for each covariate and globally. Pair it with the residual plot and, for categorical variables, log-log curves.

How do I interpret a significant Schoenfeld test?

A p-value below 0.05 for a covariate is evidence against proportional hazards for that term. Then look at the plot to see how big and what shape the change in β(t) is. In large datasets, small and clinically unimportant drifts can be significant.

Can I still use a Cox model if proportional hazards is violated?

Yes, with changes. You can stratify, add a time-varying effect, or report the hazard ratio as an average effect alongside restricted mean survival time. Say which you chose and why, and show that the main conclusion holds.

Do I need to check anything besides proportional hazards?

Yes. Check linearity of continuous covariates, influential observations and the plausibility of noninformative censoring. Each can change your estimates as much as a PH violation.

Sources