Logistic regression models binary outcomes (disease/no disease, death/survival) by relating the log-odds of the outcome to a linear combination of predictors: log(p/(1-p)) = beta_0 + beta_1*x_1 + ... + beta_k*x_k. The logit transformation maps probabilities from the bounded [0,1] interval to the unbounded real line, making linear modeling appropriate. Each coefficient beta_j represents the change in log-odds per unit increase in x_j, and exp(beta_j) gives the adjusted odds ratio — the multiplicative change in odds of the outcome for a one-unit increase in the predictor, holding all other variables constant. Logistic regression is estimated by maximum likelihood rather than least squares, and it is the workhorse model for binary health outcomes throughout clinical research and epidemiology.
Linear regression assumes the outcome is continuous and unbounded — systolic blood pressure, cholesterol level, or body weight. But many of the most important questions in health research involve binary outcomes: does the patient have the disease or not? Did the treatment succeed or fail? Did the patient survive five years or not? You cannot model a 0/1 outcome with ordinary linear regression because predicted values can fall outside [0,1], the errors are not normally distributed, and the variance depends on the mean. Logistic regression solves all three problems by modeling a transformed version of the outcome probability.
The logit transformation converts a probability p to the log-odds: logit(p) = log(p/(1-p)). If p = 0.5, the odds are 1:1 and the log-odds are 0. As p approaches 1, the log-odds go to positive infinity; as p approaches 0, they go to negative infinity. This maps the constrained probability to the entire real line, so a linear combination of predictors always produces a valid probability when passed through the inverse logit (logistic) function: p = 1/(1 + exp(-z)), where z = beta_0 + beta_1*x_1 + ... The resulting S-shaped curve ensures that predicted probabilities are always between 0 and 1, regardless of the predictor values.
The coefficients of logistic regression are interpreted on the log-odds scale. A coefficient of 0.5 for a predictor means that a one-unit increase raises the log-odds of the outcome by 0.5. Exponentiating gives the odds ratio: exp(0.5) ≈ 1.65, meaning the odds of the outcome increase by 65% per unit of the predictor. This multiplicative interpretation is constant across the predictor range on the odds scale but not on the probability scale — the change in probability for a one-unit increase depends on where you start. Moving BMI from 22 to 23 changes diabetes probability differently than moving from 35 to 36, even though the log-odds change is the same.
Logistic regression is fit by maximum likelihood estimation rather than least squares. MLE finds the coefficient values that make the observed data most probable under the model. There is no closed-form solution as there is for OLS; instead, iterative algorithms (typically Newton-Raphson or iteratively reweighted least squares) converge to the maximum. Model fit is assessed through deviance, the Hosmer-Lemeshow test, or information criteria rather than R-squared. For prediction, the area under the ROC curve (AUC) quantifies how well the model discriminates between cases and non-cases — a topic you will encounter next in diagnostic test evaluation.