Logistic Regression
Regression Analysis
Statistical Foundations of Binary Classification
Logistic regression models the probability of a binary outcome using the log-odds link function. Maximum likelihood estimation, Wald tests, and likelihood ratio tests provide rigorous statistical inference for classification problems.
-
Medical Diagnosis — Predict disease presence from patient characteristics
-
Credit Scoring — Estimate default probability for loan applications
-
Customer Analytics — Model churn likelihood from behavioral features
The sigmoid function maps any linear combination to a valid probability.
Why Not Linear Regression for Binary Data?
Linear regression is inappropriate for binary responses because:
-
The errors are not normally distributed (they are Bernoulli).
-
The predicted values can fall outside , which is impossible for probabilities.
-
The variance is not constant: , which depends on .
Logistic regression solves these problems by modeling the probability through the logistic (sigmoid) function.
The Logistic Model
DfLogistic Regression Model
Logistic regression models the probability of success as a function of predictors via the logit link function:
Equivalently, in terms of the log-odds (logit):
where .
Logistic (Sigmoid) Function
Here,
- =Probability of success given x
- =Intercept (log-odds when x = 0)
- =Coefficient for x
Odds and Odds Ratios
DfOdds
The odds of an event with probability is:
Odds ranges from 0 to . When , odds = 1. When , odds = 3 (3 to 1).
ThInterpretation of Coefficients via Odds Ratios
Exponentiating a coefficient gives the odds ratio (OR):
-
: increasing increases the odds of success
-
: increasing decreases the odds of success
-
: has no effect on the odds
Goodness of Fit
| Metric | Definition | Interpretation |
|--------|-----------|----------------|
| McFadden's | | 0.2–0.4 is considered good |
| AIC | | Lower is better; penalizes complexity |
| BIC | | Lower is better; stronger penalty than AIC |
| Hosmer–Lemeshow | Compares observed vs. predicted frequencies in deciles | Non-significant indicates good fit |
Key Takeaways
Summary: Logistic Regression
-
Logistic regression outputs probabilities via the sigmoid function — never below 0 or above 1
-
Coefficients are on the log-odds scale — exponentiate to get odds ratios
-
MLE, not OLS, is used to fit logistic regression — there is no closed-form solution
-
The Likelihood Ratio Test is more powerful than the Wald test for hypothesis testing
-
AUC–ROC is a better performance metric than accuracy for imbalanced classes
-
The logit link ensures the linear predictor maps to a valid probability
-
Odds ratios provide intuitive multiplicative interpretation of effects