Example of Cox Regression in Medicine

An example of Cox regression in medicine

An oncology study includes 180 patients who are observed after starting a therapy. Some die during follow-up, others are still alive at the end of the study, and some are lost to follow-up. A medical example of Cox regression is particularly illustrative for this situation: Not only does the event count, but also the time until the event and the incomplete observation of individual cases.

Cox regression, also known as the Cox proportional hazards model, answers a clinically relevant question: Does the instantaneous risk of an event change when an influencing factor changes, while other factors are statistically controlled? It is therefore a standard method for time-to-event data, such as overall survival, disease-free survival, recurrence, intensive care unit stay, or time to rehospitalization.

The medical example: Therapy and overall survival

Suppose overall survival after cancer therapy is being examined. The primary endpoint is death. For each person, two key pieces of information are available: the observation time in months and an event indicator. The indicator is 1 if the person died during the study, and 0 if the observation was censored.

Censoring does not mean that no information is available. If a patient is still alive after 18 months and is no longer observed after that, we at least know that no death event occurred up to month 18. A standard linear or logistic regression would not properly account for this temporal information. Cox regression, on the other hand, uses it directly.

In our example, the following influencing factors are to be considered: treatment group, age, tumor stage, and ECOG performance status. The research question could be: Is the new therapy associated with overall survival when age, disease stage, and general condition are held constant?

What Cox regression actually estimates

The result of a Cox regression is usually reported as a hazard ratio, or HR for short. The hazard describes the instantaneous risk of an event at a given point in time among the individuals who have remained event-free up to that point. It is not a simple probability, nor is it the proportion of deceased individuals.

If the treatment group has an HR of 0.68, this means: taking the other model variables into account, the estimated hazard in the new treatment group is 32 percent lower at any given point in time than in the reference group. An HR below 1 indicates a lower instantaneous risk of an event, while an HR above 1 indicates a higher risk.

For a correct professional interpretation, the 95 percent confidence interval and the p-value are always required. A possible result could look like this: HR = 0.68; 95% CI [0.49; 0.94]; p = 0.021. The confidence interval does not cross the value 1. Thus, under the model assumptions, there is statistical evidence of a difference between the treatment groups.

However, the result does not automatically prove a causal treatment effect. In a randomized study, a causal interpretation is much better justified than in a retrospective observational study. In observational data, even after adjustment, relevant confounding factors may be missing, measured inaccurately, or remain unevenly distributed between groups.

Medical example of Cox regression: Preparing data correctly

The quality of the analysis is often determined before the first model run. For a Cox regression, you need at least one time variable and one event variable. The time variable must be clearly defined in terms of its content, for example, days from surgery to death or days from randomization to recurrence. The starting point must be comparable for all cases.

For the event variable, unambiguous coding is essential. Often, 1 represents the event and 0 represents censoring. Confused coding is one of the most serious errors because it can reverse the entire interpretation. You should also document how treatment discontinuations, treatment changes, competing risks, and losses to follow-up are handled.

The coding of covariates also deserves attention. A categorical variable such as tumor stage should not be blindly entered into the model as a sequence of numbers 1, 2, 3, and 4 if no linear relationship is plausible. It is usually represented using appropriate dummy variables. For age, it should be checked whether a linear relationship with the hazard is medically plausible. If not, splines or clinically justified categories may be more appropriate.

Missing values are not a minor detail. If all cases with at least one missing value are excluded, the sample may become smaller and systematically biased. Whether a complete case analysis is justifiable or multiple imputation is required depends on the extent, pattern, and context of the missing data.

The crucial assumption: Proportional hazards

The Cox model assumes that the hazards of the compared groups are proportional. Simply put: the relative difference between the treatment group and the control group should remain approximately constant over time. If the new therapy only works in the first six months but shows no further benefit later, this assumption may be violated.

This assumption should not merely be stated but tested. Graphical checks, log-minus-log plots, and tests based on scaled Schoenfeld residuals are suitable for this purpose. A single p-value does not replace professional judgment. In small samples, tests often have little power, while in very large samples, small, practically irrelevant deviations can become statistically significant.

If the proportional hazards assumption is violated, the standard HR as an averaged effect over the entire follow-up period may be misleading. Depending on the research question, time-dependent covariates, a stratified Cox regression, separate time intervals, or alternative measures such as restricted mean survival time may be the better choice. Which solution is appropriate depends on the study objective and the clinical course.

From the model formula to a reportable result

A plausible model formula for the example can be simplified as follows: survival time and event status are explained by treatment group, age, tumor stage, and ECOG status. In R, a Surv object is typically used for this purpose, while SPSS, Stata, or Python offer comparable model options. However, the software is only a tool. What matters are the endpoint definition, data checking, model strategy, and correct professional interpretation.

In the results section of a medical paper, it is not enough to simply copy a table from the software. First, describe the sample, the follow-up period, and the number of events. Then report the HR, 95 percent confidence interval, and p-value for each relevant variable. Clearly state the reference category and explain which covariates were pre-specified as adjustment variables.

A precise wording would be: “After adjusting for age, tumor stage, and ECOG status, the new therapy was associated with lower mortality hazard (HR 0.68; 95% CI 0.49 to 0.94; p = 0.021).” In an observational study, “associated” is professionally more appropriate than “led to.”

Kaplan-Meier curves complement Cox regression but do not replace it. They clearly show the unadjusted survival course. Cox regression, on the other hand, provides the adjusted relationship of multiple influencing factors. Both representations therefore answer related but not identical questions.

Typical errors in medical Cox analyses

A common error is the uncritical inclusion of too many predictors when there are too few events. It is not the total number of patients, but above all the number of observed events that limits the complexity of the model. Too many parameters can lead to unstable estimates, wide confidence intervals, and seemingly spectacular but unsupported results.

Data-driven variable selection based solely on p-values is also problematic. Medically relevant confounders should be derived from the study design, the literature, and clinical plausibility. Anyone who only retains variables with a “significant” result in the model risks bias and an approach that is difficult to reproduce.

Particular caution is required with competing risks. If a patient dies from another cause before a possible tumor recurrence, death is not simply a regular censoring. A competing risk analysis may be required here. Time-dependent exposures, such as a treatment change during follow-up, also cannot be correctly handled if they are mistakenly modeled as baseline characteristics.

When professional statistical advice is useful

A Cox regression often appears to be quickly completed in the software. However, the methodologically sound evaluation begins with the question of whether the endpoint is appropriately defined, which cases are censored, whether competing risks are present, and which variables actually belong in the model. These points are examined critically during the review of dissertations, clinical studies, and publications.

Easy Statistik supports the planning, execution, and clear documentation of medical survival analyses—individually, discreetly, and by PhD statisticians. If you would like to have your data, model assumptions, or already generated output checked, you can request statistical advice via the contact form. A well-justified Cox regression not only creates a more convincing result but also provides confidence when faced with questions from supervisors, ethics committees, or journals.


Put knowledge into practice

From explanation
to your own analysis.

Would you like to know which method suits your project? We review your plans free of charge and give you a clear recommendation.

Your question deserves a personal answer.

Describe your project. We will assess free of charge what support would be right for you.

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.