Cox proportional hazards

Estimate associations between covariates and event hazards in right-censored follow-up data.

Method lesson · Updated October 6, 2026

Concepts and reasoning

Compare rates among people still at risk

In time-to-event analysis, the hazard at a time is an instantaneous rate among people who have not yet experienced the event. It is not a probability and can exceed 1 when expressed per a sufficiently long unit of time. A Cox model relates that rate to predictors while leaving the baseline hazard unspecified.

A treatment hazard ratio of 0.70 says that, conditional on included predictors and under proportional hazards, the modeled instantaneous rate in the treatment group is 70% of the comparison rate. It does not say that 30% fewer people will experience the event by every follow-up time. Absolute risk depends on baseline survival and time. Nor does the ratio mean that survival times are multiplied by 1/0.70.

Learn from who fails, given who could have failed

At an observed event time, the risk set contains participants still under observation and event-free immediately before that time. The partial likelihood compares the predictor values of the person who experiences the event with those of everyone in that risk set. Censored participants contribute while they remain at risk, then leave the risk set; censoring is not recorded as survival forever.

This construction avoids specifying the entire baseline hazard to estimate relative effects. It does not remove the need for assumptions. Censoring must be suitably independent of event time, conditional on modeled information, and covariate effects need an appropriate form. Tied event times also need an explicit likelihood approximation or treatment. The lifelines survival-regression documentation provides worked illustrations.

Mathematical foundations

On a small screen, scroll wide equations and tables horizontally.

The proportional-hazards model

For covariate vector ,

The baseline hazard describes the reference covariate pattern under the chosen coding. A one-unit increase in predictor , holding the others fixed, multiplies the hazard by . For a ten-unit contrast, the multiplier is ; the measurement unit therefore matters.

Ignoring tied event times for exposition, the event at time contributes

to the partial likelihood. is the risk set. The common baseline hazard cancels in this conditional comparison. Maximizing the product of these contributions estimates the coefficients.

With a compatible baseline survival function, the model implies . This relationship shows why the same hazard ratio yields different absolute survival differences when baseline prognosis differs.

Worked example

Hypothetical data for learning; independent of your analysis inputs.

Translate a coefficient into two useful interpretations

Suppose a hypothetical treatment coefficient is −0.357 with standard error 0.150. The hazard ratio is . A large-sample 95% interval for the coefficient is −0.357 ± 1.96(0.150), or approximately −0.651 to −0.063. Exponentiating both endpoints gives a hazard-ratio interval of about 0.522 to 0.939.

If control survival at two years is 0.80, the proportional-hazards model predicts treatment survival . Thus the modeled two-year absolute survival difference is approximately 0.055, not 0.30.

Control survival at a chosen timePredicted treatment survival with HR 0.700Absolute survival difference
0.8000.8550.055
0.5000.6160.116

The coefficient supplies a relative contrast; baseline survival turns it into a time-specific absolute contrast. Uncertainty in that baseline must be considered when estimating uncertainty in predicted survival.

For a partial-likelihood intuition, imagine a risk set of three participants with relative risk scores 1, 2, and 3. If the participant with score 2 has the event, the model assigns that identity a conditional probability of . Later risk sets may differ after events or censoring.

Interpreting the results

Translate a coefficient into a conditional comparison

A coefficient is a log hazard ratio. Exponentiating it gives the multiplicative change in event hazard for a one-unit increase in that covariate, holding other included covariates fixed. For a 0/1 treatment indicator, a hazard ratio of 0.75 describes a 25% lower instantaneous event hazard among those still event-free, under proportional hazards. It is not a 25% increase in survival time or a 25-percentage-point survival benefit.

Confidence limits describe uncertainty in the fitted hazard ratio. An interval containing one does not prove no association; examine its width and the effects still compatible with the data. Predictor units matter: an age coefficient per year differs from one per decade.

A survival curve adds an estimated baseline survival function to the covariate effects. State which covariate profile it represents. A curve for average covariates is not automatically the average survival curve of the population, especially for mixtures of distinct groups.

Assumptions and limitations

Check the risk set and the effect model

Follow-up needs a common, defensible time origin and event definition. Ordinary right censoring assumes that, conditional on relevant modeled information, remaining event risk is not systematically different just because observation ends. Delayed entry, recurrent events, or time-varying covariates need methods that represent those features explicitly.

Proportional hazards means the covariate hazard ratio is constant over time, not that either group's hazard is constant. The log-hazard is linear in supplied covariates unless nonlinear transformations are added. Numeric category codes do not automatically define separate category effects.

Independent participant records and sufficient event information are needed for stable estimation. Strong collinearity or separation can make coefficients poorly determined. Adjustment establishes an association conditional on included variables; causal interpretation additionally requires an appropriate study design and assumptions about confounding.

Diagnostics and sensitivity analysis

Use diagnostics to investigate specific departures

Examine proportional-hazards diagnostics alongside clinical expectations and time-related residual patterns. A small diagnostic p-value suggests the constant-effect summary may be inadequate; a large p-value does not establish proportionality, particularly with few events. The lifelines regression documentation describes these checks and alternative model structures.

Review predictor coding, event counts by category, large standard errors, and correlations among covariates. Inspect functional form and influential observations using an analysis environment that supports those diagnostics. Do not delete observations simply because they weaken a preferred association.

Concordance measures ordering of predicted risks, not calibration or causality. A model can rank people reasonably while giving inaccurate absolute survival probabilities. Assess calibration at relevant time points and stability under defensible model specifications before using individual predictions.

References and other material

Read the methodological references and supporting tutorials below. The examples in this lesson are original teaching calculations, not findings from these sources.

Related method guides