Sub topic 13
When the dependent variable is categorical: logit and probit
Prerequisites and the modeling choice
This chapter assumes that you can read a multiple regression equation, interpret a slope, and use p-values and confidence intervals. You should also understand that a dependent variable is the outcome a model tries to explain.
A standard linear regression is inappropriate when the dependent variable records a category rather than a measured amount. For example, a borrower either defaults or does not default. The outcome can be coded as 1 for default and 0 for no default, but these numbers are labels, not quantities with meaningful distances.
For a binary outcome, use a binary response model:
- Logit models the probability through the logistic curve.
- Probit models the probability through the cumulative standard normal curve.
- A linear probability model uses OLS with a 0/1 outcome. It can be a useful approximation, but it has important weaknesses.
Logit and probit working models
Let p represent the probability that the outcome equals 1. A logit model can be written as:
log(p / (1 - p)) = β0 + β1X1 + ... + βkXk
The left side is the log odds, where odds equal p divided by 1 minus p. A logit coefficient measures the change in log odds when its predictor increases by one unit, holding other predictors constant.
Exponentiating a logit coefficient gives an odds ratio. If exp(β1) equals 1.25, a one-unit increase in X1 multiplies the odds of the outcome by 1.25, or increases the odds by 25%. This does not mean that the probability rises by 25 percentage points.
A probit model assumes an unobserved, or latent, continuous index:
Y* = β0 + β1X1 + ... + βkXk + ε
The observed outcome equals 1 when Y* exceeds a threshold and equals 0 otherwise. Probit coefficients describe effects on this latent index. Their signs indicate the direction of the effect, but their sizes are not directly probability changes.
Logit and probit usually produce similar fitted probabilities. Logit is often easier to interpret because of odds ratios. Probit is common when the normal-error latent-index interpretation is useful.
Interpreting probability effects
For both models, the effect of a predictor on probability depends on the starting values of all predictors. Therefore, do not interpret a coefficient as a constant probability-point change.
For logit, the marginal effect of Xj is:
βj p(1 - p)
This effect is largest near p = 0.5 and smaller when p is close to 0 or 1. Statistical software can report marginal effects at the average observation or average marginal effects across the sample.
import numpy as np
import statsmodels.api as sm
rng = np.random.default_rng(7)
n = 400
income = rng.normal(size=n)
p = 1 / (1 + np.exp(-(-0.6 + 1.1 * income)))
default = rng.binomial(1, p)
X = sm.add_constant(income)
logit = sm.Logit(default, X).fit(disp=False)
probit = sm.Probit(default, X).fit(disp=False)
print("Logit coefficients:", logit.params)
print("Logit odds ratio:", np.exp(logit.params[1]))
print("Logit average marginal effect:")
print(logit.get_margeff().summary())
print("Probit coefficients:", probit.params)
print("Predicted probability at average income:")
average_case = np.array([[1, income.mean()]])
print(logit.predict(average_case)[0])
print(probit.predict(average_case)[0])Assumptions and model comparison
Logit and probit require independent observations unless the model explicitly accounts for clustering or repeated measurements. The predictors should be specified with an appropriate functional form, and the sample should contain observations in both outcome categories. Perfect separation occurs when predictors classify every 0 and 1 without error. In that case, maximum-likelihood estimates may not exist or may become extremely large.
Use likelihood-ratio tests, coefficient tests, predicted probabilities, and classification diagnostics to evaluate a model. AIC and BIC can compare logit and probit models fitted to the same observations, although their coefficients are on different scales. Lower AIC or BIC indicates a preferred balance of fit and complexity, not proof that the model is correctly specified.
| Model | Main interpretation | Common limitation |
|---|---|---|
| Linear probability model | Coefficient is a probability-point change | Can predict below 0 or above 1 |
| Logit | Coefficient is a change in log odds; exp(coefficient) is an odds ratio | Odds ratios can be mistaken for probability changes |
| Probit | Coefficient changes a latent normal index | Coefficients are less directly interpretable |
Exercise
Exercise
A logit coefficient for an investment-risk indicator is 0.40. What is the associated odds ratio, and why is it incorrect to say that the probability increases by 40 percentage points?
Show answer
The odds ratio is exp(0.40), approximately 1.49. The coefficient implies about 49% higher odds, holding other variables constant. The probability change depends on the initial probability and the other predictors.