Durgical
EN
Open the app

Logistic regression

  • Statistical test

It models a yes-or-no outcome from several variables and gives odds ratios (OR) adjusted for the others.

Updated

What it is

Logistic regression is used when the outcome is binary (ill or well, alive or dead). It models the log of the odds of the outcome as a sum of explanatory variables; raising e to each coefficient gives an odds ratio (OR) adjusted for the other variables in the model. It is the usual tool for controlling confounding in case-control and cross-sectional studies.

When to use it

  • A dichotomous outcome with one or more explanatory variables.
  • Case-control, cross-sectional and fixed-follow-up cohort studies.
  • If time to the event matters and there is censoring, the Cox model is used.

Worked example

  1. Data: myocardial infarction cases and controls. Smokers: 60 cases and 140 controls. Non-smokers: 40 cases and 260 controls.
  2. Crude OR = (60 × 260) / (140 × 40) = 15 600 / 5 600 = 2.79.
  3. The smokers in the study are older, so a model with smoking and age is fitted.
  4. Smoking coefficient = 0.69, so adjusted OR = e^0.69 ≈ 2.0.
  5. Age coefficient = 0.04 per year: OR = e^0.04 ≈ 1.04 per year and e^0.4 ≈ 1.49 per 10 years.
  6. The smoking OR fell from 2.79 to 2.0 after adjustment: age partly confounded the association.
  7. Reading: at the same age, smokers have about twice the odds of infarction of non-smokers.

Markers

  • OR
  • logit
  • e^b

Assumptions and pitfalls

  • Reading the OR as a relative risk when the outcome is common (the OR exaggerates the RR).
  • Interpreting the coefficient b directly without turning it into an OR (e^b).
  • Putting many variables into a model with few events (overfitting and very wide intervals).
  • Forgetting that adjustment cannot fix confounding by variables that were not measured.

Test yourself

Think of the answer, then tap the question to see it.

What type of outcome does logistic regression model?

A binary outcome, such as ill or well, alive or dead.

How is the OR obtained from a coefficient b?

By raising e to the coefficient: OR = e^b. If b = 0, OR = 1.

A crude OR of 3.0 falls to 1.2 after adjusting for age. What does it show?

That age was an important confounder: much of the crude association was explained by age.

If a numerical variable’s coefficient is 0.05 per year, what is the OR per 10 years?

e^(10 × 0.05) = e^0.5 ≈ 1.65.

Add to my cards (4)

Connections

← All of epidemiology

Educational content on epidemiological and statistical methods; the examples use made-up numbers to teach the calculation. Not a clinical or legal guide: current Colombian rules are in the official sources.

Sources: Chapter 6: Choosing effect measures and computing estimates of effect (Cochrane, 2024); Principles of Epidemiology | Lesson 3 - Section 5 (Centers for Disease Control and Prevention, 2012).

Spotted a mistake?We are always improving for the community. Tell us what is wrong and our team will review it.Report a mistake

Representative model, for educational purposes only.