[Durgical](https://durgical.com/en/) › [DurgiPedia](https://durgical.com/en/durgipedia/) › [Epidemiology](https://durgical.com/en/epidemiology/) › [Biostatistics](https://durgical.com/en/epidemiology/areas/stats/) › Logistic regression

# Logistic regression

- Statistical test

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

Updated Nov 5, 2026

## Key points

- Binary outcome; numerical or categorical explanatory variables.
- Model: logit(p) = ln[p / (1 − p)] = a + b1x1 + b2x2 + …
- Adjusted OR = e^b. b = 0 means OR = 1 (no association).
- For a numerical variable, e^b is the OR per one-unit increase; for an increase of 10, e^(10 × b).
- When the crude OR changes a lot after adjustment, the added variable was a confounder.
- Rule of thumb: at least about 10 events per variable in the model to avoid unstable estimates.

## 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

- Data: myocardial infarction cases and controls. Smokers: 60 cases and 140 controls. Non-smokers: 40 cases and 260 controls.
- Crude OR = (60 × 260) / (140 × 40) = 15 600 / 5 600 = 2.79.
- The smokers in the study are older, so a model with smoking and age is fitted.
- Smoking coefficient = 0.69, so adjusted OR = e^0.69 ≈ 2.0.
- Age coefficient = 0.04 per year: OR = e^0.04 ≈ 1.04 per year and e^0.4 ≈ 1.49 per 10 years.
- The smoking OR fell from 2.79 to 2.0 after adjustment: age partly confounded the association.
- 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.

## Memory aid

‘Exponentiate the coefficient and the OR appears’: e to the power b is the adjusted odds ratio.

## 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)](https://durgical.app/estudiar/?add=/en/epidemiology/logistic-regression/)

## Connections

## Related 5

- [Odds ratio](https://durgical.com/en/epidemiology/odds-ratio/)
- [Linear regression](https://durgical.com/en/epidemiology/linear-regression/)
- [Controlling confounding](https://durgical.com/en/epidemiology/controlling-confounding/)
- [Case-control study](https://durgical.com/en/epidemiology/case-control-study/)
- [Confounding](https://durgical.com/en/epidemiology/confounding/)

[← All of epidemiology](https://durgical.com/en/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](https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-06) (Cochrane, 2024); [Principles of Epidemiology | Lesson 3 - Section 5](https://archive.cdc.gov/www_cdc_gov/csels/dsepd/ss1978/lesson3/section5.html) (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.

---
Source: https://durgical.com/en/epidemiology/logistic-regression/
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite as: DurgiPedia (durgical.com), https://durgical.com/en/epidemiology/logistic-regression/
