Generalized Linear Model — Definition, Formula & Example
A generalized linear model (GLM) is a regression model that lets the response be a count, a yes/no outcome, or another non-normal quantity. It applies a linear equation to a transformed version of the response's mean instead of to the mean itself.
A GLM has three components. The random component says each response follows a distribution from the exponential family, such as normal, binomial, Poisson, or gamma. The systematic component is a linear predictor . A monotone, differentiable link function connects them through , where . The coefficients are usually estimated by maximum likelihood. Ordinary linear regression is the special case with a normal response and the identity link .
Key Formula
Where:
- = the link function, such as the logit for yes/no outcomes or the natural log for counts
- = the expected value (mean) of the response variable for the given predictor values
- = the intercept of the linear predictor
- = the coefficient on predictor number j, measured on the scale of the link function
- = the value of predictor number j
Worked Example
Problem: A logistic regression (a GLM with a binomial response and logit link) models the probability p that a student passes an exam after studying x hours: . Find the predicted probability of passing for a student who studies 10 hours.
Step 1: Compute the linear predictor (the log-odds) by substituting x = 10.
Step 2: Undo the logit link to return to the probability scale. The inverse of the logit is the logistic function.
Step 3: Compare with x = 8, where the log-odds are 0 and p = 0.5. Two extra hours add exactly 1 to the log-odds but only about 0.231 to the probability. The model is linear on the link scale, not the probability scale, so p can never leave the interval from 0 to 1.
Answer: The predicted probability of passing after 10 hours of study is about 0.731, or 73.1%.
Why It Matters
Insurance actuaries price policies with Poisson and gamma GLMs for claim counts and claim sizes. Medical researchers use logistic regression to estimate disease risk from yes/no outcomes. Both are standard topics in a second college statistics or biostatistics course.
Common Mistakes
Mistake: Reading a coefficient as a direct change in the mean, for example saying each extra study hour raises the pass probability by 0.5.
Correction: Coefficients act on the link scale. In the example, 0.5 is the increase in log-odds per hour. Each hour multiplies the odds by . The change in probability depends on where you start.
