← 6. Survival analysis
Cox Proportional Hazards Model
Try this analysis →

Cox Proportional Hazards Model

Instead of looking only at whether an event happened, it analyzes how risk factors relate to the time until the event.

Survival timeCensoringHazard ratio (HR)Proportional hazards assumption

No comorbidityWith comorbidityCensoredDays after surgeryProportion without readmission

Why does the time to readmission differ among patients who had the same heart surgery? Are patients with comorbidities readmitted sooner? Can we also use the information from patients who were not readmitted by the end of observation?

The method for analyzing the relationship between the time until an event and risk factors is the Cox proportional hazards model.

If you only compare whether patients were readmitted, you lose the information about how many days after surgery they were readmitted. The Cox model uses the time of the event and the length of follow-up, and it also handles censored data, where the event was not observed during follow-up. The effect of a variable is expressed as a hazard ratio (HR), which compares the instantaneous risk at a given time.

It is used not only in medical research but in any situation where the timing of an event matters, such as machine failure, customer churn, or the time it takes to find a job. In this lesson we use readmission after heart surgery as an example to cover censored data, interpreting hazard ratios, how the model differs from Kaplan–Meier and AFT models, the proportional hazards assumption, and reporting the results.

SECTION 1

What is the Cox proportional hazards model?

It links the time until an event to explanatory variables.

The Cox proportional hazards model is a survival analysis method that analyzes the relationship between the timing of patients’ readmission and risk factors. Rather than simply comparing whether patients were readmitted, it also uses the length of follow-up and the information from patients who have not yet been readmitted.

The model estimates how much the hazard, the instantaneous event rate among people who have not yet had the event at a given time, changes with the explanatory variables.

SECTION 2

Why do we need the Cox proportional hazards model?

It handles patients with different observation periods and censored data together.

If a patient readmitted 30 days after surgery and a patient not readmitted over 120 days are treated the same, important time information is lost. Some patients may also drop out of the study during follow-up or reach the end of observation.

Key point: it takes into account both the timing of readmission for readmitted patients and the follow-up time of patients whose readmission was not observed. However, assumptions such as censoring being independent of the outcome need to be examined.
SECTION 3

How does the Cox proportional hazards model work?

It combines a baseline hazard function with the relative effects of the explanatory variables.

The Cox model expresses the hazard function as h(t|X) = h₀(t) × exp(β₁X₁ + ··· + βₖXₖ). h₀(t) is the baseline hazard function, and the exponential of each coefficient, exp(β), is the hazard ratio (HR).

ComponentMeaning in this analysis
Time tTime from the date of surgery to readmission or censoring
Event indicatorReadmission observed = 1, end of observation or loss to follow-up = 0
Explanatory variablesAge, comorbidity, type of surgery
Hazard ratio HRRelative size of the instantaneous readmission risk when the other variables are held equal

The Cox model is a semiparametric method that estimates the regression coefficients using the partial likelihood, without specifying the shape of the baseline hazard function in advance.

SECTION 4

A real-world example: risk of readmission after heart surgery

We compare readmission risk by age, comorbidity and type of surgery.

Suppose 300 hypothetical heart surgery patients were followed for up to 120 days after surgery. For each patient, we record the last date they were seen and whether they were readmitted. The numbers below are hypothetical results to illustrate the flow of the analysis, not the results of fitting real patient data.

VariableTypeExample
Follow-up timeContinuous, in days15 days, 72 days, 120 days
ReadmittedEvent indicatorReadmitted 1 / Censored 0
AgeContinuousInterpreted per 10-year increase
ComorbidityCategoricalNo / Yes
Type of surgeryCategoricalA / B
Readmission-free proportion after surgery100%75%50%25%0%0306090120 daysRelatively lower riskHigher risk
Hypothetical readmission-free survival curves · an illustration of differences between groups
SECTION 5

How do you interpret the hazard ratio (HR)?

The HR is the relative size of the risk, not a ratio of probabilities or of times.

HR = 1 means the two conditions being compared have the same risk. HR > 1 means the risk is higher, and HR < 1 means it is lower. For example, HR = 1.85 is the model’s statement that, adjusting for other factors, the instantaneous risk of readmission is about 85% higher at any point in time.

Hazard ratios (HR) and 95% confidence intervals0.51.01.52.02.5HR = 1 is the reference · a conceptual exampleAge (per 10 years)With comorbiditySurgery type B (vs. A)1.301.851.20
Mock-up of HRs by age, comorbidity and type of surgery · dots are estimates, horizontal lines are 95% confidence intervals
Caution: HR = 1.85 should not be interpreted as “the probability of readmission is 85 percentage points higher” or “85% of patients are readmitted.”
SECTION 6

How are censored patients handled?

The fact that an event was not observed is also used in the analysis.

PatientWhat was observedInformation entered into the model
AReadmitted 28 days after surgeryTime 28 days, event 1
BNot readmitted through day 120Time 120 days, event 0 (administrative censoring)
CLost to follow-up on day 80Time 80 days, event 0 (censored during follow-up)

Censored patients provide the information that the event had not occurred by the time of censoring. It is not assumed that they were never readmitted after censoring. Also, if patients can die before being readmitted, consider whether treating this as simple censoring is valid, and consider a competing risks analysis.

SECTION 7

Which numbers do you check in Cox regression results?

Check not only the hazard ratios but also their uncertainty and the model assumptions.

Explanatory variablesHR95% confidence intervalp-value
Age (per 10 years)1.301.10–1.54.002
With comorbidity1.851.34–2.56< .001
Surgery type B (vs. A)1.200.88–1.64.247

In these hypothetical results, age and comorbidity are associated with a higher risk of readmission. Surgery type B has an HR above 1, but its confidence interval includes 1, so it is hard to conclude there is a clear difference. These are teaching numbers set to be consistent with one another, not estimates fitted to data.

SECTION 8

How do the Cox model and Kaplan–Meier analysis differ?

Distinguish a method for comparing survival curves from a method for adjusting for several factors at once.

ComparisonKaplan–Meier / log-rank testCox Proportional Hazards Model
Main purposeShow the event-free proportion over time and compare groupsEstimate hazard ratios accounting for several covariates
Explanatory variablesMainly group categoriesContinuous and categorical covariates together
Main outputSurvival curves, log-rank testHR, 95% CI, regression coefficients
Key conditionsAssumptions about censoringCensoring assumptions + proportional hazards assumption, etc.
SECTION 9

How do the Cox model and AFT models differ?

The difference is whether you look at a ratio of risks or at how much the time to the event is stretched or shortened.

The Cox model describes the instantaneous hazard ratio (HR) of the event when other conditions are equal. The accelerated failure time (AFT) model focuses on how much the explanatory variables stretch or shorten the time until the event.

MethodTypical interpretationSuitable question
CoxHR = 1.30 → instantaneous risk 30% higherWhich patients have a higher risk of readmission?
AFTTime ratio = 0.80 → time to the event is 0.8 times as longHow much shorter is the time to readmission?

The two models rest on different assumptions, so rather than choosing one just because it is easier to interpret, choose based on the data and the research question.

SECTION 10

Things to watch out for with the Cox proportional hazards model

If you don’t check the assumptions, a single HR may not be an adequate summary.

Proportional hazards assumption: is the HR roughly constant over time?Constant HRRight after surgeryEnd of follow-upNo strong trend over time
Conceptual diagram of the proportional hazards assumption · actual diagnostics use Schoenfeld residuals and similar tools

Proportional hazards assumption: assumes that each explanatory variable’s HR is constant over time. Check Schoenfeld residuals, interactions with time and so on; if the assumption does not hold, consider time-varying effects or a stratified Cox model.

Linearity: for continuous variables such as age, check whether the relationship with the log hazard is linear. You can also use splines.

Censoring and event definitions: clearly define the reasons for dropout, what counts as readmission, the start of follow-up, and competing events such as death.

Causation: hazard ratios from observational data show adjusted associations and do not remove the influence of unmeasured confounders.

SECTION 11

What extensions of Cox analysis are there?

Extend the model to fit the follow-up structure and any violations of assumptions.

MethodSuitable situation
Stratified Cox modelWhen the baseline hazard differs across levels of some variables
Cox model with time-varying covariatesWhen explanatory variables, such as medication status, change during follow-up
Time-varying coefficient modelWhen the effect (HR) of an explanatory variable changes with follow-up time
Recurrent event modelsWhen the same patient can be readmitted several times
Competing risks modelsWhen events compete, such as death before readmission
SECTION 12

How do you report Cox proportional hazards results?

Report the number of patients, the follow-up period, the event definition and the hazard ratios together.

When writing up the results, present the study population, the follow-up period, the definitions of the event and censoring, the covariates, the hazard ratios and confidence intervals, and the results of checking the proportional hazards assumption.

Sample write-up

A Cox proportional hazards model was fitted to examine risk factors for readmission among heart surgery patients (hypothetical data, N = 300, maximum follow-up 120 days). Adjusting for the other variables, the risk of readmission was higher with each 10-year increase in age (HR = 1.30, 95% CI [1.10, 1.54], p = .002), and patients with a comorbidity also had a higher risk of readmission (HR = 1.85, 95% CI [1.34, 2.56], p < .001). The difference between surgery types B and A was not clear (HR = 1.20, 95% CI [0.88, 1.64], p = .247).

A real paper should add information produced by the actual analysis, such as the number of events, the number censored, and the results of checking the proportional hazards assumption. This example does not claim that those diagnostics were carried out.

SECTION 13

Where can the Cox proportional hazards model be used?

It is used in studies where timing matters and follow-up periods differ.

FieldResearch question
MedicineWhat factors are related to the time until readmission or death after surgery?
Industrial safetyHow does the working environment affect the time until equipment fails?
Customer analyticsWhat characteristics affect the time until a subscription is canceled?
EmploymentHow is completing a training program related to the time it takes to find a job?
Public healthHow are risk factors related to the time until disease onset?
✓ Wrap-up

The Cox proportional hazards model looks at the time until an event and risk factors together.

It uses censored observations too, and summarizes the relationship between several explanatory variables and the instantaneous risk as HRs. When reading the results, always check the proportional hazards assumption and the confidence intervals as well.


The Cox proportional hazards model estimates the relationship between explanatory variables and the instantaneous risk, taking into account not only whether an event happened but when. In the example of readmission after heart surgery, it described the relationship of patients’ age, comorbidity and type of surgery with the time until readmission in terms of hazard ratios (HR).

A hazard ratio does not directly mean the probability of readmission over a given period or the average time to readmission. When interpreting it, check the confidence interval and the definitions of the event and censoring, and examine the proportional hazards assumption that the hazard ratio is constant over time. If the assumption does not hold, also consider methods that allow effects to change over time.

KEY TAKEAWAY

Analyze not only whether an event happened but the time until it happened. Information from patients whose event has not yet been observed is also used, as censored data. The HR is not a probability but the relative size of the instantaneous risk. Interpret it against HR = 1, and read it together with the 95% confidence interval. Examine the proportional hazards assumption. If effects change over time, a different model or an extension may be needed.