Logistic Regression in Medical Research: A Practical Guide

When you ask a clinical researcher what they study, the answer is often a yes or no. Did the patient die? Come back to the hospital within 30 days? Respond to the drug? Logistic regression is the main method used by researchers in medicine to analyze what factors are associated with outcomes after accounting for everything else in the model.

We will go over the ins and outs of the method, the sort of data the method works with, how to interpret adjusted odds ratios (AORs), what to consider to assess the trustworthiness of the output, how to run it in SPSS, STATA and R, and how to present the output.

What is Logistic Regression in Medical Research?

Basically, logistic regression is the calculation of the probability of an outcome given one or more factors and how that changes the odds of that outcome. If that outcome is defined as having only two possible values, you’ve done binary logistic regression. This is the most common form you’ll see in clinical journals.

Two-option outcomes are incredibly common in epidemiology. Examples include:

– Death vs. survival

– Readmission vs. no readmission

– Treatment response vs. no response

In this field, we generally work with two kinds of variables. The first is the outcome (or dependent) variable. This variable is what we are trying to explain. The second type is the predictors (sometimes called independent variables or covariates). Predictors are the factors that we think may be associated with the outcome variable, and may include age, sex, smoking, lab values, etc.

What about linear regression? Well, linear regression works great to predict continuous variables, like blood pressure. If we direct linear regression toward a yes/no outcome, it will happily generate a probability of 1.3, or minus 0.2. Logistic regression also works on the log odds, and so it keeps every probability between 0 and 1.

An example of an outcome in this field could be wound infections in the surgical population. The outcome is infection, yes or no. In this case, smoking is the major predictor, and age and diabetes are also predictors.

Which test fits which outcome type, and when to go to logistic regression versus ANOVA or a t-test, is covered in which statistical test to use in medical research.

When Should You Use Binary Logistic Regression?

The key question is whether your outcome is binary. If your patients all end up in one of two groups (for example, admitted to the ICU or not, culture positive or negative, dead or alive at 90 days), then binary logistic regression is appropriate.

Deciding which outcome to model, and how study design determines what variables are available, is covered in cross sectional study design in medical research and the case-control and cohort guides alongside it.

Predictors can be either continuous or categorical. Continuous predictors include age or serum creatinine; categorical predictors include sex or disease stage.

There are two versions of the logistic regression model. The first is the crude model, which describes the outcome based on the effect of a single predictor. The second is the adjusted model which describes the outcome based on the effect of multiple predictors. Predictors can vary, and the results can show an outcome is associated with the effect of one or more predictors. However, the outcome can also be attributed to something else that was not measured.

How to Interpret Logistic Regression Results

Logistic regression shows the effect a predictor has on an outcome in the form of an odds ratio (OR). If the model has multiple predictors, then each odds ratio is considered adjusted (AOR) and reflects the effect of that predictor, holding all other predictors in the model constant.

For categorical predictors, everything is compared to a reference category. Set “non-smoker” as the reference. The AOR tells us how the odds of “smokers” compare to “non-smokers”. For continuous predictors, the AOR tells us how the odds change for each unit change. If you entered your age as 40, the AOR tells us how the odds change for each 40 year increase.

1 is your anchor:

Above 1, odds increase. for example, an AOR of 1.30 means the odds increased by 30%.

Below 1, odds decrease. for example, an AOR of 0.70 means the odds decreased by 30%.

At 1, no change.

Next, look at the 95% CI. if it includes 1, then at the 0.05 level, we can’t say for sure that there is an effect. The p-value tells us how well the data fits with no association, but it says nothing about the size of the effect.

Here is an example for a made-up mortality study. The numbers are for illustration and are not based on any clinical studies.

PredictorAOR (95% CI)P-value
Age, per 10-year increase1.40 (1.15 to 1.70)0.001
Diabetes1.25 (0.90 to 1.74)0.18

Age is the clear finding. Every extra 10 years goes with 40% higher odds of dying in hospital, holding the other variables steady, and the CI stays above 1.

Diabetes is murkier. The estimate points toward higher odds, but the CI runs from 0.90 to 1.74. That range covers lower odds, no change, and higher odds, so the honest answer is “inconclusive.” It doesn’t mean diabetes has no effect.

One last trap: odds aren’t risk. A 40% rise in odds is not a 40% rise in risk, and when the outcome is common (over about 10%), the gap gets wide. Stick to the word “odds.”

The difference between an odds ratio and a risk ratio, when they are close and when they diverge, is covered in relative risk versus odds ratio. The gap matters most when the outcome is common, which it often is in logistic regression.

Biostatistics

A 40% rise in odds is not a 40% rise in risk. That gap is where most misreadings begin.

Odds, risk, probability, adjusted versus crude, confidence intervals versus p values. Each distinction matters when you write it up and again when a reviewer reads it. Learn what sits underneath the output so the interpretation is right before the paper goes anywhere.

Build the Foundation →

Assumptions and Diagnostics of Logistic Regression

Software will give you a result no matter what. Whether that result means anything depends on a handful of checks.

  • Independence. Each row should be a separate, unrelated patient. If the same person shows up across several visits, or patients are grouped by hospital, you’ll need a mixed-effects model or generalized estimating equations (GEE).
  • Confounding and clustering are design problems as much as they are analysis problems. Case control study design covers how the choice of comparator affects what confounders need to enter the model.
  • Sensible specification. Code the outcome clearly (1 = died, 0 = survived) and pick predictors for clinical or evidence-based reasons. Throwing in whatever reached p < 0.05 in the crude analysis tends to produce shaky models.
  • Linearity in the logit. Continuous predictors should relate to the log odds in a straight line. The Box-Tidwell test or restricted cubic splines will show you if they don’t. Resist the urge to cut age into bands just to get around this, since you lose information.
  • Multicollinearity. Put weight and BMI in the same model and the estimates start to wobble. The variance inflation factor (VIF) catches this. People quote cutoffs of 5 or 10, but they’re rules of thumb, and VIF only looks at the predictors, not the model as a whole.
  • Influential points and separation. Check residuals and Cook’s distance for patients pulling the results around. Separation is when a predictor perfectly predicts the outcome. You’ll notice absurd ORs or a model that won’t converge. Firth’s penalized regression usually sorts it out.
  • Events per variable (EPV). Count the patients with the rarer outcome and divide by the number of parameters. Too few, and the model overfits: it looks great on your data and falls apart on anyone else’s. The “10 EPV” rule gets repeated a lot, but Riley and colleagues (BMJ, 2020) showed the real number depends on the outcome rate, the number of parameters, the expected performance, and how precise you need to be.

How to Assess Model Fit and Performance

Don’t judge a model by one statistic. Each one answers a different question.

MeasureWhat it tells youMain limitation
Hosmer-Lemeshow testWhether observed and predicted events differ across risk groupsA nonsignificant result doesn’t prove good calibration, and it depends on sample size and grouping
Calibration plotWhether predicted probabilities match observed ratesNeeds enough events to be stable
ROC curve and AUCHow well the model ranks patients with the outcome above those without itSays nothing about calibration or clinical usefulness
Sensitivity and specificityShare of true cases caught and non-cases correctly clearedBoth shift with the cutoff you choose

Calibration is easiest to picture with an example. If the model says a group of patients has a 20% chance of dying, roughly 1 in 5 of them should actually die.

The AUC goes from 0.5, which is a coin toss, to 1.0, which is perfect. People often read an AUC of 0.80 as “80% accurate.” It isn’t. It means that if you grab one patient who died and one who survived, the model will rate the one who died as higher risk 80% of the time.

A model can rank patients in the right order and still overestimate everyone’s risk. That’s why you look at both discrimination and calibration.

ROC curves and the area under the curve are also core outputs in diagnostic accuracy studies. Sensitivity, specificity and ROC curves explained covers how to read AUC in that context.

How to Perform Logistic Regression in SPSS, STATA, and R

SPSS, STATA, and R all do the job. Only the menus and commands differ.

  • SPSS: Analyze → Regression → Binary Logistic. The outcome goes in Dependent and predictors in Covariates. Click Categorical to set reference groups. In Options, tick “CI for exp(B)” and, if you want it, “Hosmer-Lemeshow goodness-of-fit.” The Exp(B) column is your odds ratio.
  • A full SPSS walkthrough with annotated output is in the SPSS tutorial for medical research.
  • STATA: logistic outcome age i.diabetes prints odds ratios straight away. logit runs the same model in log odds, so add , or to switch. Follow up with estat gof, group(10) for Hosmer-Lemeshow and lroc for the ROC curve.
  • R: glm(outcome ~ age + diabetes, family = binomial, data = df). Wrap the coefficients and confidence intervals in exp() to get ORs and CIs. For diagnostics, use vif() from the car package and the pROC package for AUC.

That’s only the starting point. For full walkthroughs with output screenshots, see our SPSS, STATA, and R tutorials.

Software Tutorials

The command is two lines. Reading what comes back takes rather longer.

SPSS output tables, Stata log odds versus odds ratios, R model objects and the pROC package. Full walkthroughs with annotated screenshots, starting from data entry and ending at a table you can paste into your manuscript.

See the SPSS Tutorial →

How to Report Logistic Regression in a Medical Research Paper

A good write-up lets someone else repeat your analysis. Make sure your paper covers:

  • What the outcome was, how many patients you had, and how many events occurred
  • Why you picked those predictors
  • AORs, 95% CIs, and exact p-values (p = 0.03, not p < 0.05), apart from very small ones like p < 0.001
  • How you dealt with missing data
  • Which diagnostics you ran and, for prediction models, how you validated the model

Something like this works for the Results section (hypothetical data):

Of 512 patients, 74 (14.5%) died in hospital. After adjusting for sex, diabetes, and admission creatinine, each 10-year increase in age was associated with higher odds of in-hospital mortality (AOR 1.40, 95% CI 1.15 to 1.70, p = 0.001). Diabetes was not significantly associated with mortality (AOR 1.25, 95% CI 0.90 to 1.74, p = 0.18).

Also say up front what kind of study it is. Explanatory analyses ask whether a factor is tied to an outcome once you adjust for others. Prediction studies build a tool to estimate a patient’s risk, and those should be reported using TRIPOD+AI, the current guideline for prediction models built with regression or machine learning.

Frequently Asked Questions

Q1. What is binary logistic regression used for in medical research?

Mostly to find which factors are tied to a yes/no outcome, like death or recovery, after adjusting for other variables.

Q2. What is a good AUC value?

Roughly, 0.7 to 0.8 is acceptable and anything above 0.8 is good. But a high AUC with poor calibration still won’t give you a useful model.

Q3. How many events per variable are needed?

Ten is the number you’ll hear most, but treat it as a starting point. A proper sample-size calculation for your study is more reliable.

Conclusion

If your outcome is yes or no, binary logistic regression is probably the method you need. Read the AORs with care, run the checks, and report everything. Next, try it on your own data with our SPSS logistic regression tutorial.

Research Mentorship

The software runs without complaint. What it runs is still your responsibility.

EPV check, VIF, Hosmer-Lemeshow, calibration plot, AUC, missing data plan. SPSS gives you a result whether or not you have enough events to support the model. A statistician checks the things the output doesn’t flag.

The American Academy of Research & Academics works with medical students, residents and early career researchers on study design, statistical analysis and manuscript preparation. If your regression is done and you are not sure what it is telling you, bring us the output.

Talk to a Mentor →

Disclaimer:

Articles published by American Academy of Research & Academics are prepared by our team using information from direct experience, publicly available resources, and educational references. AI tools may be used to assist with drafting, proofreading, and formatting; however, all content undergoes review and approval before publication.
The information provided is intended for educational purposes only. Requirements, policies, and processes may change over time. Readers should consult official sources for the most current information.

Facebook
Twitter
LinkedIn
Email
0

No products in the basket.