← back to statistics

Multiple and Logistic Regression

OpenIntro Statistics · CC BY-SA 3.0 · Chapter 9

Multiple regression uses several predictors to model a continuous outcome. Logistic regression models a binary outcome using the sigmoid function. Both extend simple regression: one by adding predictors, the other by changing the link function.

x p 1 0.5 0 p(x) = 1/(1+e⁻ˣ)

Multiple predictors

The model y = b0 + b1*x1 + b2*x2 + ... + bp*xp uses p predictors. Each coefficient bi represents the expected change in y for a one-unit increase in xi, holding all other predictors constant. This "holding constant" interpretation is the difference from running p separate simple regressions.

Scheme

Adjusted R-squared

For least-squares models with an intercept fitted to the same observations, adding predictors cannot decrease R-squared, even when they have no useful predictive signal. Adjusted R-squared penalizes for the number of predictors: R-adj = 1 - (SSE/(n-p-1)) / (SST/(n-1)). It increases only when the reduction in residual error outweighs this penalty; an increase alone does not establish that the predictor will help on new data.

Scheme

Multicollinearity

When predictors are correlated with each other, individual coefficients become unstable: large standard errors, sign flips, sensitivity to which observations are included. The variance inflation factor (VIF) quantifies this: VIF = 1 / (1 - R^2_j), where R^2_j is from regressing predictor j on all other predictors. VIF above 5-10 signals trouble.

Scheme

Predicting a yes or a no

Imagine a model for passing a practice test. A straight line could predict a probability below zero or above one. A logistic curve keeps the prediction between those limits.

These coefficients are invented for exploration, not fitted to evidence about studying. The model is predictive; changing a slider does not establish a causal effect.

Model probability of passing
Logistic curve; at 4 hours the model predicts 31.0 percent.0%50%100%0510Study hours

At 4 hours, predicted probability: 31.0%. Odds: 0.45 to 1.

Keep the coefficient fixed and move along the curve. One more hour always adds the same amount to log odds, but its change in probability depends on where you start.

Read the curve as a table
HoursProbability
01.8%
13.9%
28.3%
316.8%
431.0%
550.0%
669.0%
783.2%
891.7%
996.1%
1098.2%
Compress the curve into a model

log(p / (1 โˆ’ p)) = bโ‚€ + bโ‚x. Here bโ‚€ = โˆ’4 and bโ‚ = 0.8. p / (1 โˆ’ p) is odds; log means the natural logarithm. Each extra hour multiplies the odds by ebโ‚ = 2.23.

Equivalently, p = 1 / (1 + eโˆ’(bโ‚€ + bโ‚x)). Multiple logistic regression adds more predictors inside the same expression.

A moment to think

A coefficient implies that one extra unit doubles the odds, holding other predictors fixed. Does it also double the probability?

Logistic regression

For a binary outcome (0 or 1), linear regression can predict probabilities outside 0-1. Logistic regression fixes this by modeling the log-odds: log(p/(1-p)) = b0 + b1*x. Solving for p gives the sigmoid: p = 1 / (1 + e^-(b0+b1*x)). The coefficients represent changes in log-odds, not in probability.

Scheme

Odds ratios

The odds of an event is p/(1-p). In logistic regression, e^b1 is the odds ratio: the factor by which the odds multiply for each one-unit increase in x. An odds ratio of 2.23 means the odds more than double per unit increase. This is the natural scale for interpreting logistic coefficients.

Scheme

Notation reference

Symbol Formula Meaning
R²_adj1-(SSE/(n-p-1))/(SST/(n-1))Adjusted R-squared
VIF1/(1-R²_j)Variance inflation factor
logit(p)log(p/(1-p))Log-odds (link function)
σ(z)1/(1+e⁻ᶻ)Sigmoid function
OReᵇ¹Odds ratio
Neighbors

Cross-references

  • Cogsci Ch.4 — neural networks use logistic (sigmoid) activation functions

Foundations (Wikipedia)