Binary logistic regression is a statistical method that predicts the probability of a yes-or-no outcome based on one or more input variables. Instead of predicting a number on a continuous scale (like weight or temperature), it estimates how likely something is to fall into one of two categories: pass or fail, alive or dead, positive or negative. It’s one of the most widely used tools in medicine, social science, and machine learning.
How It Differs From Linear Regression
Linear regression predicts a continuous number. It draws a straight line through your data and uses that line to estimate outcomes like days of hospitalization or lung capacity. Binary logistic regression predicts a category. The outcome variable has only two possible values, often coded as 0 and 1.
This distinction matters because a straight line is a poor fit for binary outcomes. If you tried to use linear regression to predict whether a patient will survive surgery (yes or no), the model could spit out predictions like 1.4 or negative 0.3, values that make no sense as probabilities. Logistic regression solves this by using a special curve that keeps all predictions between 0 and 1.
The Sigmoid Curve
At the heart of binary logistic regression is the sigmoid function. It takes any input value, no matter how large or small, and squashes it into a number between 0 and 1. Mathematically, the function is 1 / (1 + e raised to the negative input), but what matters more than the formula is what it does: it creates an S-shaped curve. At one extreme, the predicted probability approaches 0. At the other, it approaches 1. In the middle, the probability shifts rapidly.
This S-shape reflects how many real-world phenomena actually behave. A small increase in a risk factor might barely budge someone’s probability of disease when they’re already at very low or very high risk. But for someone near the tipping point, that same increase can make a meaningful difference. The sigmoid captures this nonlinear behavior naturally.
Odds, Log-Odds, and the Logit
To understand what the model actually computes, you need to know three related concepts: probability, odds, and log-odds.
Probability is straightforward. If there’s a 75% chance of something happening, the probability is 0.75. Odds express the same information differently: they compare the chance of something happening to the chance of it not happening. A probability of 0.75 translates to odds of 3:1, meaning success is three times more likely than failure.
Log-odds (also called the logit) take this one step further by applying a natural logarithm to the odds. This transformation is the key trick in logistic regression. While probabilities are stuck between 0 and 1, and odds can only be positive, log-odds can range from negative infinity to positive infinity. That makes them compatible with a linear equation. The model combines your input variables into a weighted sum, and that sum equals the log-odds of the outcome. The sigmoid function then converts those log-odds back into a probability.
The full equation looks like this: the log-odds of the outcome equals a baseline constant plus a coefficient times each predictor variable. Each coefficient represents how much a one-unit increase in that predictor shifts the log-odds.
Interpreting the Coefficients
Raw logistic regression coefficients are in log-odds, which aren’t intuitive. To make them useful, you convert them into odds ratios by raising the mathematical constant e to the power of the coefficient. The resulting odds ratio tells you how much the odds of the outcome change for every one-unit increase in that predictor.
An odds ratio of 1.0 means no effect. An odds ratio of 2.0 means that a one-unit increase in the predictor doubles the odds of the outcome. An odds ratio of 0.5 means it cuts the odds in half. This is the standard way results from logistic regression are reported in research papers and clinical studies.
For example, if a model predicting heart attack risk produces an odds ratio of 1.8 for smoking status, that means smokers have 1.8 times the odds of a heart attack compared to nonsmokers, after accounting for the other variables in the model.
How the Model Learns Its Coefficients
Linear regression finds its best-fit line by minimizing the squared distance between predictions and actual values. That approach doesn’t work for logistic regression because the outcome is binary, not continuous. Instead, logistic regression uses a technique called maximum likelihood estimation.
The idea is intuitive: the model tries different coefficient values and asks, “Given these coefficients, how likely is it that I would have seen the actual data I observed?” It then adjusts the coefficients to maximize that likelihood. There’s no single algebraic solution to this problem, so the model uses an iterative process, refining its estimates step by step until it converges on the best values. This all happens behind the scenes in statistical software.
Three Assumptions the Model Requires
Binary logistic regression requires three assumptions to produce reliable results.
- Independence of observations. Each data point must be unrelated to the others. If you measure the same patient multiple times, or if patients are clustered within hospitals, this assumption breaks down and requires different modeling approaches.
- No perfect multicollinearity. The predictor variables can’t be perfectly correlated with each other. Some correlation is fine, but if one predictor is an exact linear combination of others, the model can’t separate their individual effects.
- Linearity with the log-odds. Continuous predictors need to have a linear relationship with the log-odds of the outcome. This doesn’t mean the relationship with the probability itself is linear (it isn’t, thanks to the sigmoid curve). It means that each additional unit of the predictor shifts the log-odds by a consistent amount. You can test this and, if needed, transform variables to meet the assumption.
Violating these assumptions doesn’t necessarily crash the model. It still produces numbers. But those numbers may be biased or fail to generalize beyond your specific dataset.
How to Evaluate Model Performance
Once a logistic regression model is built, you need to know whether it actually works. The most common evaluation tools are the confusion matrix and the AUC-ROC curve.
A confusion matrix is a simple 2×2 table. It sorts every prediction into one of four buckets: true positives (correctly predicted yes), true negatives (correctly predicted no), false positives (predicted yes but actually no), and false negatives (predicted no but actually yes). From this table, you can calculate sensitivity, the percentage of actual positives the model caught, and specificity, the percentage of actual negatives it correctly identified.
The tradeoff between sensitivity and specificity depends on the threshold you choose. If the model outputs a probability of 0.6, do you classify that as a yes or a no? A lower threshold catches more true positives but also generates more false alarms. A higher threshold is more conservative but misses more real cases. The ROC curve plots this tradeoff across all possible thresholds, and the area under that curve (AUC) summarizes overall performance in a single number. An AUC of 0.5 means the model is no better than flipping a coin. An AUC of 1.0 means perfect discrimination. Most useful models fall somewhere in between, with values above 0.7 or 0.8 generally considered acceptable depending on the application.
Real-World Applications
Binary logistic regression is a workhorse in clinical medicine. Emergency departments use it to estimate the probability that a patient with chest pain is having a genuine cardiac event, combining factors like blood enzyme levels, blood pressure, and heart rhythm readings into a single risk score. Surgical teams use it to predict complications. In one example, researchers built a model to predict unplanned reintubation after thoracic surgery using a frailty index alongside standard preoperative assessments. In another, a model evaluated whether a specific eye-coordination problem could predict hospital admission for post-concussion syndrome after mild traumatic brain injury.
Outside medicine, the applications are just as broad. Credit scoring models predict whether a borrower will default. Marketing teams predict whether a customer will churn. Email filters predict whether a message is spam. In each case, the structure is the same: multiple input variables, a binary outcome, and a need to estimate probability rather than just make a hard yes-or-no call. The model’s ability to output calibrated probabilities, not just classifications, is what makes it so versatile. A doctor doesn’t just want to know “high risk” or “low risk.” They want to know the patient has a 12% chance versus a 74% chance, because those numbers lead to very different clinical decisions.

