
Cox Regression: The Proportional Hazards Model Explained
How Cox proportional hazards regression works, how to check the PH assumption, read hazard ratios, and report a Cox model in APA 7 or clinical style.
Cox regression (the Cox proportional hazards model) is the standard multivariable method for time-to-event data. Use it when your outcome is "time until something happens" (death, relapse, readmission, device failure), some participants are censored, and you want to estimate the effect of several predictors at once. Its output is a hazard ratio for each predictor, adjusted for the others.
If you have already plotted Kaplan-Meier curves and run a log-rank test, Cox regression is the next step: it tells you how much a factor changes the event rate and lets you control for confounders. (For the basics of censoring and KM curves, start with our survival analysis primer.)
What the Cox model actually estimates
The model describes the hazard, the instantaneous event rate at time t among people still at risk, as:
h(t | x) = h0(t) × exp(b1·x1 + b2·x2 + ... + bk·xk)
h0(t)is the baseline hazard: the hazard for someone with all predictors equal to zero. Cox's key insight is that you never have to specify its shape. That is why the model is called semi-parametric.b1 ... bkare the regression coefficients, estimated by maximizing a partial likelihood that depends only on the order of event times, not on the baseline hazard.exp(b)is the hazard ratio (HR) for a one-unit increase in that predictor, holding the others constant.
Because the predictors multiply the baseline hazard by a constant factor, the ratio of hazards between two people stays the same at every time point. That is the proportional hazards (PH) assumption, and it is the assumption you must check.
When to use Cox regression
Use it when:
- The outcome is time to a single, well-defined event.
- Some observations are censored (follow-up ended before the event), and censoring is unrelated to the risk of the event (non-informative).
- You want adjusted effect estimates for one or more predictors, continuous or categorical.
Consider something else when:
- You only need to compare two or three groups with no adjustment: Kaplan-Meier plus log-rank may be enough.
- The outcome is binary with fixed follow-up and no censoring (everyone followed for exactly 30 days, say): logistic regression is simpler.
- There are competing events that prevent the event of interest (death before relapse): consider competing-risks methods such as cause-specific hazards or the Fine-Gray model.
- You need the absolute survival curve shape or plan to extrapolate beyond follow-up: parametric survival models (Weibull, log-normal) may suit better.
Sample size: events per variable
The effective sample size in Cox regression is the number of events, not the number of participants. A common rule of thumb is at least 10 events per predictor parameter (a categorical variable with four levels uses three parameters). With 60 events, aim for about six parameters. Rules of thumb are rough; for a planned study, run a proper calculation (see our guide to power analysis and sample size).
A worked example
Suppose a retrospective cohort of 420 patients after colorectal surgery, followed for recurrence. 138 patients recurred; the rest were censored at last follow-up. You fit a multivariable Cox model with four predictors. The output (from R, SPSS, or Stata, all give the same columns) looks like this:
| Predictor | B | SE | Wald z | p | HR | 95% CI for HR |
|---|---|---|---|---|---|---|
| Adjuvant therapy (yes vs no) | −0.478 | 0.162 | −2.95 | .003 | 0.62 | 0.45, 0.85 |
| Age (per 10 years) | 0.231 | 0.071 | 3.25 | .001 | 1.26 | 1.10, 1.45 |
| Stage III (vs I–II) | 0.693 | 0.180 | 3.85 | < .001 | 2.00 | 1.41, 2.85 |
| Male sex (vs female) | 0.105 | 0.158 | 0.66 | .506 | 1.11 | 0.81, 1.51 |
Every column comes from B and SE:
HR = exp(B), for exampleexp(−0.478) = 0.62.95% CI = exp(B − 1.96·SE)toexp(B + 1.96·SE), for exampleexp(−0.478 − 0.318) = 0.45andexp(−0.478 + 0.318) = 0.85.Wald z = B / SE. SPSS reports the Wald chi-square instead, which is z squared (8.71 for adjuvant therapy) with 1 df. Same test, same p value.
How to interpret the coefficients
Binary predictor. Adjuvant therapy HR = 0.62: at any given time during follow-up, patients who received therapy had a recurrence hazard 0.62 times that of patients who did not, after adjusting for age, stage, and sex. Equivalently, a 38% lower hazard ((1 − 0.62) × 100).
Continuous predictor. Age HR = 1.26 per 10 years: each additional decade is associated with a 26% higher hazard. Always state the unit. If age had been entered in years, the HR would be about 1.02 per year, which looks trivial but is the same effect. Rescale continuous variables to a meaningful unit before fitting.
Categorical predictor. Stage III HR = 2.00 means double the hazard compared with the reference category (stage I–II). Name the reference category in every table.
Non-significant predictor. Male sex HR = 1.11, 95% CI 0.81 to 1.51. The interval includes 1, so the data are compatible with anything from a 19% lower to a 51% higher hazard. That is "no clear evidence of an association," not "no effect."
Two cautions:
- A hazard ratio is a ratio of rates, not of cumulative risks. An HR of 2.00 does not mean twice the probability of recurrence by five years. The hazard ratio guide explains how HR differs from relative risk and odds ratio.
- The HR is a summary across follow-up. It is only a fair summary if the PH assumption holds.
Checking the proportional hazards assumption
Reviewers routinely ask how you checked the PH assumption. Use at least one formal and one graphical method.
1. Schoenfeld residuals (formal test)
Schoenfeld residuals are computed for each predictor at each event time. If the PH assumption holds, they show no trend against time. The test correlates the scaled residuals with (a function of) time and gives a p value per predictor plus a global test.
- In R:
cox.zph(fit)from thesurvivalpackage gives per-variable and global tests;plot(cox.zph(fit))draws the smoothed residuals over time. - A small p value (say below .05) suggests the effect of that predictor changes over time.
- With large samples, trivial departures become "significant." Look at the plot: a roughly flat smoothed line means the violation is unlikely to matter.
2. Log-minus-log plot (graphical check)
For a categorical predictor, plot ln(−ln S(t)) against ln(t) for each group, where S(t) is the Kaplan-Meier estimate. Under proportional hazards, the curves should be roughly parallel. Curves that converge, diverge sharply, or cross point to a violation. SPSS offers this as the "log minus log" plot in the Cox regression dialog.
3. Other quick checks
- Kaplan-Meier curves that clearly cross are a warning sign.
- Add an interaction between the predictor and time (or log time). A significant interaction means the HR changes over follow-up.
What to do if the assumption fails
- Stratify on the offending variable (if it is a confounder you do not need an HR for). Each stratum gets its own baseline hazard.
- Model the time-varying effect: include a predictor × time interaction (in R, the
tt()argument incoxph) and report how the HR changes. - Split follow-up into periods (for example 0–12 months and after 12 months) and report a separate HR for each.
- Report restricted mean survival time differences as a complementary summary that does not rely on PH.
Other model checks worth reporting
- Linearity of continuous predictors: plot martingale residuals against the predictor or fit a spline. If the relationship bends, categorize carefully or use a spline term.
- Influential observations: dfbeta residuals show which patients move the coefficients most.
- Ties: when several events share a time, software approximates the likelihood. R's
coxphuses the Efron method by default; SAS PROC PHREG defaults to Breslow. State which you used. - Discrimination: Harrell's concordance index (C-index) summarizes how well the model ranks patients by risk; 0.5 is chance and 1.0 is perfect.
- Multicollinearity: highly correlated predictors inflate standard errors. Check correlations or a variance inflation factor from an equivalent linear model.
How to report Cox regression (APA 7 and clinical style)
Report in the Methods: the time origin, the event, censoring rules, the predictors and how they were coded, how you chose them, the ties method, how you checked PH, and the software and version.
Methods sentence:
Time to recurrence was measured from the date of surgery. Patients without recurrence were censored at their last follow-up. We used a multivariable Cox proportional hazards model including adjuvant therapy, age (per 10 years), stage, and sex, selected a priori. The proportional hazards assumption was assessed with scaled Schoenfeld residuals and log-minus-log plots; no violations were detected (global test p = .41). Analyses used R 4.4 with the survival package.
The global test p value above is a placeholder: report your own.
Results sentence (APA 7):
Of 420 patients, 138 (32.9%) experienced recurrence. After adjustment for age, stage, and sex, adjuvant therapy was associated with a lower hazard of recurrence, HR = 0.62, 95% CI [0.45, 0.85], p = .003. Stage III disease was associated with a higher hazard compared with stage I–II, HR = 2.00, 95% CI [1.41, 2.85], p < .001.
APA 7 points to follow: italicize statistical symbols such as p and z, but write abbreviations such as HR and CI in roman type; drop the leading zero for p values (p = .003) but keep it for HRs and CIs, which can exceed 1; give exact p values to two or three decimals and write p < .001 for smaller ones; put CIs in square brackets.
Clinical journal style (NEJM, Lancet, JAMA and many others) typically writes: "hazard ratio, 0.62; 95% CI, 0.45 to 0.85; P=0.003." Check your target journal's instructions; the content is the same.
Table. Present unadjusted and adjusted HRs side by side, with the reference category for each categorical variable and the number of events. A forest plot of adjusted HRs on a log scale with a reference line at 1 works well as a figure.
Common mistakes
- Calling the HR a risk ratio. "Twice the risk" is loose; "twice the hazard" is accurate.
- Not checking PH, or checking it and not saying so.
- Too many predictors for the number of events, which gives unstable, inflated HRs.
- Univariable p-value screening as the only variable-selection method. Prefer predictors chosen a priori from subject knowledge or a causal diagram.
- Inconsistent time origin (some patients timed from diagnosis, others from surgery).
- Immortal time bias: classifying patients by an exposure that happens after time zero (for example, "received a transplant at any time") credits the exposed group with event-free time they had to survive to get exposed. Treat such exposures as time-varying covariates.
- Ignoring competing risks when a different event (often death) prevents the event of interest.
FAQ
Is Cox regression parametric or non-parametric?
Semi-parametric. The effect of predictors is modeled parametrically (the exp(b·x) part), but the baseline hazard is left unspecified.
What is the difference between Cox regression and logistic regression?
Logistic regression models whether an event happened during a fixed period and gives odds ratios. Cox regression models when it happened, uses censored follow-up properly, and gives hazard ratios. If follow-up times vary and some people are censored, Cox is the right choice.
Can I use Cox regression with a time-varying covariate?
Yes. Use the counting-process (start, stop, event) data format so each person contributes several rows as the covariate changes. This is also how you avoid immortal time bias.
How many events do I need?
A common rule of thumb is at least 10 events per predictor parameter. Fewer events per variable makes coefficients unstable; penalized methods or fewer predictors are safer options.
Does a non-significant Schoenfeld test prove the PH assumption?
No. It means you found no strong evidence of a violation. With small samples the test has low power, so inspect the residual plot as well.
From data to a written Results section
If you have a clinical dataset with follow-up time, event status, and covariates, Data2Paper's Generate Paper can run Kaplan-Meier curves, log-rank tests, and Cox regression and draft the Methods and Results with tables and figures. You can generate and preview the first half for free; unlocking the full draft is a one-time $19.90. It is an AI-generated draft, so check every number and claim against your own analysis before submission. For a broader workflow, see the clinical data analysis guide.
著者

カテゴリ
もっと読む

トピックを入力するだけで文献レビューが仕上がる:Data2Paper の Research Report
Data2Paper の Research Report は、研究テーマから出発して、実在する文献の引用付きで構造化された文献レビューを生成します。テーマ別の統合考察と、PDF・Word・LaTeX 形式のダウンロードに対応しています。


5 名の独立した査読者による AI 査読:Data2Paper の Paper Review が原稿を診断する仕組み
Data2Paper の Paper Review は、専門領域の異なる 5 名の AI 査読者、引用の整合性検証、編集判定、優先度付きの改稿ロードマップで、編集委員会レベルの査読を再現します。


Heteroscedasticity: Tests, Fixes, and How to Report It
What heteroscedasticity is, how to spot it in residual plots, how to run Breusch-Pagan and White tests, and how to fix and report it with robust SEs.

ニュースレター
コミュニティに参加
最新のニュースとアップデートをニュースレターでお届けします