Ask Mallard
Core concept

Choosing logistic regression or Cox regression

4 min read

Logistic regression asks whether the outcome happened by a fixed time; Cox regression asks how fast it happens over follow-up, so the question and the follow-up decide.

Fit

When it matters, and when it does not

It matters when

  • You must decide whether the question concerns outcome status at a fixed time or event timing.
  • Follow-up differs between patients, so a simple fixed-horizon binary analysis may discard information.

It matters less when

Before you start

What to check in your study

Decide these first
  1. Whether you want a risk by a set time or a rate over timeoutcomeTypesummaryMeasureA risk at one year is a different quantity from a hazard ratio. Fix it before choosing a model.
  2. The fixed time, if there is oneSuch as 30 days after discharge. Choose it for a clinical reason, before seeing the data.
  3. Whether every patient's status at that time is knownIf some left before it, their status is unknown, and a method for censored data is needed.
  4. Whether another event can prevent the outcomecompetingEventsDeath before readmission is the usual one. It needs its own handling in either model.
It rests on these
  1. For logistic regression, outcome status at the fixed time is known for everyone analyzed.How to check: Count how many left before it, and why. If many did, a method for censored data uses the time they were followed.
  2. For Cox regression, patients who leave have the same outlook as similar patients who stay.How to check: Record why each patient left, and compare those censored early with those followed longer.

Plain language

How it works

Define the outcome and its time window before choosing the model. Logistic regression models whether the outcome happened by a fixed time, such as readmission within 30 days. Cox regression models the rate of the event over follow-up, using each patient's time at risk. A dataset with dates does not by itself make a hazard ratio the answer.

Follow-up against a fixed horizon
Four people followed toward a fixed horizon. One has the outcome before the horizon, one after it, one is followed past the horizon without the outcome, and one is censored before the horizon, whose status at the horizon is unknown and cannot be coded as event-free.An outcome by a fixed horizon, and what happens to someone censored before itHorizonOutcome before thehorizonOutcome after thehorizonNo outcome, followedpast the horizonCensored before thehorizonStatus at horizon unknownTimeLogistic regression needs outcome status at the horizon for everyone. Coding the censored person asevent-free is not a valid shortcut; a time-to-event method uses the time they were observed.Outcome occursFollow-up ends without the outcome (censored)
Conceptual diagram. It shows the structure of the idea, not data from any study.
What each model reports

Logistic odds ratios and Cox hazard ratios answer different questions. Adding a prognostic factor can change either ratio even without confounding. That is non-collapsibility, not confounding. Choose the target quantity first. When risks at set times answer the question, estimate those directly rather than reading them from a hazard ratio.

Worked example

A worked example

Invented for illustration
Setting
1,200 adults after hip fracture surgery, all followed for one year through a national death register.
Question
Is delirium after surgery linked to death within one year?
Approach
Everyone's status at one year is known, and the question is the risk by one year, so logistic regression fits. It adjusts for age and frailty.
Result
The adjusted odds ratio for death within one year, with delirium against without, was 2.
What it means
If 20 in 100 without delirium died, about 33 in 100 with delirium would. That is about 1.7 times the risk, not 2 times. This is an association.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

Logistic odds ratios and Cox hazard ratios answer different questions. Coding someone censored before the horizon as event-free is not a valid shortcut.

  • Reading a hazard ratio as a ratio of risks by the end of follow-up.Instead: It compares event rates over time. Report the risk in each group at stated times as well.
  • Reading an odds ratio as a risk ratio when the outcome is common.Instead: They are close only when the outcome is rare. Convert to risks, or report a risk ratio or risk difference.
  • Censoring deaths from other causes in a Cox model, then reading one minus survival as the risk.Instead: That overstates the risk. Use a competing-risks method to estimate the cumulative incidence.
  • Choosing Cox regression only because the data hold dates.Instead: Dates do not make a hazard ratio the answer. Decide first whether you want a risk by a set time or a rate over time.

Inside Mallard

How Mallard uses this

Mallard's method list may include logistic regression for a yes-or-no outcome with an odds ratio, and Cox regression for time to an event with a hazard ratio. If competing events are recorded but the analysis never says how they are handled, Mallard warns. Plans do not link to it yet.

No Mallard code example points to this page.
Atlas node concept.choosing_logistic_cox, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Primer on binary logistic regression (opens in a new tab) · Fam Med Community Health · doi 10.1136/fmch-2021-001290
  2. Statistics notes. The odds ratio (opens in a new tab) · BMJ · doi 10.1136/bmj.320.7247.1468
  3. Survival analysis-part 2: Cox proportional hazards model (opens in a new tab) · Indian J Thorac Cardiovasc Surg · doi 10.1007/s12055-020-01108-7
  4. Survival Analysis and Interpretation of Time-to-Event Data: The Tortoise and the Hare (opens in a new tab) · Anesth Analg · doi 10.1213/ANE.0000000000003653
Prepared with AI assistance. PubMed record verified, confirm it supports this use. Record checks do not establish independent methodological approval.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.