Cox proportional hazards regression is a survival analysis method that estimates how one or more predictors relate to the rate at which an event happens over time, while handling the fact that not everyone in a study experiences the event before it ends. It produces a hazard ratio, the relative rate of the event in one group compared with another at any given moment, without requiring you to assume a particular shape for the underlying survival curve. That flexibility is why it is the workhorse of clinical and epidemiological time-to-event analysis.
Survival data are different from the outcomes ordinary regression handles. The outcome is not simply whether an event occurred but when, and many participants are censored, meaning the study ended or they were lost to follow-up before the event happened. You know only that they survived event-free up to a certain point. Cox regression and its companion, the Kaplan-Meier estimator, are built to use that partial information rather than discard it.
Kaplan-Meier and Cox: two tools, two jobs
The Kaplan-Meier estimator describes survival. It produces the familiar stepped survival curve showing the probability of remaining event-free over time, and groups can be compared visually and tested with the log-rank test. It is descriptive and unadjusted: it shows what happened in each group but cannot account for other variables.
Cox proportional hazards regression explains and adjusts. It estimates the effect of a predictor on the hazard while holding other covariates constant, which is what you need when groups differ on characteristics beyond the exposure of interest. In practice the two are used together: Kaplan-Meier curves and a log-rank test to show the unadjusted picture, then a Cox model to estimate adjusted hazard ratios. Choosing the right combination for a given question is part of what our biostatistics consulting service does on clinical datasets.
Interpreting a hazard ratio
The central output of a Cox model is the hazard ratio. A value of 1 means no difference in the event rate between groups. A value above 1 means a higher rate, and below 1 a lower rate. A hazard ratio of 1.5 for a treatment, for example, indicates the event occurs at one and a half times the rate in that group at any given instant, with the confidence interval and p-value telling you the precision and statistical significance.
A common error is to read a hazard ratio as a risk ratio or as a statement about how many people will eventually have the event. It is a ratio of instantaneous rates, not of cumulative outcomes, and it does not by itself tell you the difference in median survival. Reporting it alongside Kaplan-Meier curves gives readers both the rate comparison and the absolute survival picture. The distinction between rate-based and risk-based measures parallels the issues covered in our logistic regression guide for binary outcomes.
The assumption that defines the method
The model is named for its key assumption: proportional hazards. It assumes the hazard ratio between groups stays constant over the whole follow-up period. If a treatment's effect grows, shrinks, or reverses over time, the assumption is violated and a single hazard ratio misrepresents the data.
Checking this assumption is not optional. Analysts inspect scaled residuals over time, test the residual-time correlation formally, and examine whether survival curves cross. When the assumption fails, options include adding a time-varying effect, stratifying on the offending variable, or modeling distinct time periods. Reporting a hazard ratio without ever checking proportional hazards is one of the most frequent reasons a survival analysis draws reviewer criticism.
Reporting standards
A sound survival analysis reports the number of events and the censoring, presents Kaplan-Meier curves with a numbers-at-risk table, states the variables in the Cox model, gives hazard ratios with confidence intervals, and documents how the proportional hazards assumption was checked. If you are digitizing survival data from a published figure for a secondary analysis or meta-analysis, our survival curve digitizer extracts the underlying time-to-event data from a Kaplan-Meier plot. Aligning the whole analysis to the reporting standard for your study design is part of what our research methodology support provides.
Common mistakes
- Skipping the proportional hazards check. A constant hazard ratio is an assumption that must be tested, not presumed.
- Reading a hazard ratio as a risk ratio. It compares instantaneous rates, not cumulative outcomes or median survival.
- Ignoring censoring. Treating censored participants as event-free or dropping them biases the estimate.
- Reporting Cox without Kaplan-Meier. The adjusted ratio and the absolute survival picture answer different questions; readers need both.
- Overfitting with too many covariates. The number of events, not the number of participants, limits how many predictors the model can support.
What the model actually estimates: the partial likelihood
The Cox model writes the hazard for a participant with covariates x as the product of an unspecified baseline hazard and an exponential term:
h(t | x) = h0(t) * exp( b1*x1 + b2*x2 + ... + bk*xk )
The clever part is that the baseline hazard h0(t), the event rate over time for a reference participant, is never estimated to get the hazard ratios. Cox's partial likelihood conditions on the ordered event times and asks, at each event, which of the people still at risk was the one who failed. Because h0(t) is shared by everyone in the risk set, it cancels, leaving a likelihood that depends only on the coefficients. This is why the method is called semiparametric: it makes no assumption about the shape of the survival curve, yet still estimates covariate effects.
One technical choice matters more than people expect: tied event times. When two events share a time, the software must approximate the partial likelihood. The Efron approximation is the sensible default and is far more accurate than the older Breslow method when ties are common; reserve the exact method for heavily tied discrete-time data. If your output looks off and you have many ties, check which approximation was used.
The hazard ratio is a slippery estimand
Two subtleties keep the hazard ratio from being the simple number it appears to be. First, like the odds ratio, it is non-collapsible: adjusting for a strong predictor of survival shifts the hazard ratio even when that predictor is not a confounder. Second, and less well known, the hazard ratio has a built-in selection effect over time (Hernan, 2010). The risk set at later times is made up of survivors, who are systematically different from the original cohort, so a hazard ratio that looks constant can still hide a changing effect. The practical response is to stop treating a single hazard ratio as the whole story: report it alongside an absolute, time-anchored measure such as survival at a fixed horizon, or a restricted mean survival time, which has a plain interpretation (average event-free time up to a chosen point) and does not depend on proportional hazards at all.
When proportional hazards fails, you have real options
Test the assumption formally with scaled Schoenfeld residuals (the cox.zph function), looking at both the global test and each covariate, and inspect the residual plots rather than trusting the p-value alone. When it fails, the fix depends on the pattern:
- A time-varying effect. Interact the covariate with a function of time so the hazard ratio is allowed to change, and report how it changes rather than a single average.
- Stratification. Stratify on the offending variable, which lets each stratum keep its own baseline hazard while you estimate the other effects.
- A different estimand. Switch to a restricted mean survival time difference, which summarises the whole follow-up in one interpretable number when the curves are not proportional.
- A parametric model. An accelerated failure time model (for instance Weibull or log-normal) models survival time directly and can be more efficient and easier to interpret when its distributional assumption fits.