Logit Model

ECON 3209 · Week 15, Lecture 2 · Kerala Agricultural University

Department of Development Economics, KAU

Autumn 2026

Learning Outcomes

By the end of this lecture, you should be able to:

  1. write the logistic probability model and connect it to odds and log-odds
  2. explain why maximum likelihood is used instead of OLS
  3. interpret logit coefficients using odds ratios and marginal effects
  4. estimate a logit model in Python with Kerala loan data
  5. compare fitted logit probabilities with LPM intuition

From LPM to Logit

  • We want a model that keeps probabilities between 0 and 1.
  • The logit model maps any linear index into the unit interval using the logistic function.
  • Let \(z_i = \beta_0 + \beta_1 X_{1i} + \cdots + \beta_k X_{ki}\).

\[P(Y_i=1|X_i) = \frac{e^{\beta_0+\beta_1 X_i}}{1+e^{\beta_0+\beta_1 X_i}} = \Lambda(\beta_0+\beta_1 X_i)\]

  • As \(z_i \to -\infty\), probability approaches 0; as \(z_i \to +\infty\), it approaches 1.

Odds and Log-Odds

  • If \(p_i = P(Y_i=1|X_i)\), then odds are \(p_i/(1-p_i)\).
  • The logit model assumes the log-odds are linear in regressors:

\[\log\left(\frac{p_i}{1-p_i}\right)=\beta_0+\beta_1 X_{1i}+\cdots+\beta_k X_{ki}\]

  • A one-unit increase in \(X_j\) changes the log-odds by \(\beta_j\).
  • Exponentiating \(\beta_j\) gives the odds ratio.

Estimating Logit with Maximum Likelihood

  • OLS is not appropriate because the conditional mean is nonlinear.
  • We choose \(\beta\) to maximise the likelihood of observing the sample outcomes.
  • For each observation:
    • if \(Y_i=1\), contribution is \(p_i\);
    • if \(Y_i=0\), contribution is \(1-p_i\).
  • The MLE uses all sample information and respects the binary nature of the dependent variable.

Python Demo: Fitting Logit

Reading the Coefficients

  • The sign of a coefficient tells us whether the regressor raises or lowers default risk.
  • Magnitude in raw coefficient form is harder to read than in OLS because it affects log-odds, not probability directly.
  • That is why we often report:
    1. odds ratios \(e^{\beta_j}\),
    2. average marginal effects, or
    3. predicted probabilities for meaningful borrower profiles.

Odds Ratios in Python

Marginal Effects

  • In logit, the effect of income on probability depends on the current value of \(X\).
  • Marginal effect for regressor \(X_j\) is:

\[\frac{\partial P(Y=1|X)}{\partial X_j}=\Lambda(z)(1-\Lambda(z))\beta_j\]

  • The slope is largest in the middle of the S-curve and small near 0 or 1.
  • So probability effects are not constant across individuals.

Average Marginal Effects in Python

Kerala Example: Borrower Profiles

For a cooperative bank manager, logit is useful because we can compare realistic borrower cases: - low income, no collateral, risky district; - medium income, collateral, better repayment history; - high income, collateral, strong credit score.

The model translates these profiles into predicted default probabilities for decision-making.

The Logistic Curve

Exercise

Estimate a logit model for default using income, collateral, district, and credit score. Then compute one predicted probability for a borrower with income = 30, collateral = 0, district = 1, and credit score = 55.

Summary

  • ✅ Logit uses the logistic function to keep probabilities between 0 and 1.
  • ✅ Coefficients are easiest to communicate through odds ratios, marginal effects, and predicted probabilities.
  • ✅ MLE is the natural estimation method for binary outcomes in the logit model.
  • ✅ Compared with LPM, logit gives more realistic probability predictions.

Next Lecture

  • We study the probit model, which uses the normal CDF instead of the logistic function.
  • You will compare logit and probit predictions in Python.
  • We also introduce ROC curves for classification performance.