Mathwords logoMathwords

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 YiY_i follows a distribution from the exponential family, such as normal, binomial, Poisson, or gamma. The systematic component is a linear predictor ηi=β0+β1xi1+⋯+βkxik\eta_i = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_k x_{ik}. A monotone, differentiable link function gg connects them through g(μi)=ηig(\mu_i) = \eta_i, where μi=E[Yi]\mu_i = E[Y_i]. The coefficients are usually estimated by maximum likelihood. Ordinary linear regression is the special case with a normal response and the identity link g(μ)=μg(\mu) = \mu.

Key Formula

g(μ)=β0+β1x1+β2x2+⋯+βkxkg(\mu) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_k x_k
Where:
  • gg = the link function, such as the logit for yes/no outcomes or the natural log for counts
  • μ\mu = the expected value (mean) of the response variable for the given predictor values
  • β0\beta_0 = the intercept of the linear predictor
  • βj\beta_j = the coefficient on predictor number j, measured on the scale of the link function
  • xjx_j = 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: ln⁡ ⁣(p1−p)=−4+0.5x\ln\!\left(\frac{p}{1-p}\right) = -4 + 0.5x. 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.
η=−4+0.5(10)=1\eta = -4 + 0.5(10) = 1
Step 2: Undo the logit link to return to the probability scale. The inverse of the logit is the logistic function.
p=11+e−η=11+e−1≈0.731p = \frac{1}{1 + e^{-\eta}} = \frac{1}{1 + e^{-1}} \approx 0.731
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.
η(8)=−4+0.5(8)=0  ⇒  p=11+e0=0.5\eta(8) = -4 + 0.5(8) = 0 \;\Rightarrow\; p = \frac{1}{1 + e^{0}} = 0.5
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 e0.5≈1.65e^{0.5} \approx 1.65. The change in probability depends on where you start.

Related Terms

  • Model — The general idea of a model that a GLM specializes
  • Linear Fit — The straight-line trend that a GLM extends
  • Linear Regression — Special case using a normal response and identity link
  • Regression — Parent family of methods that GLMs extend
  • Regression Equation — Supplies the linear predictor inside the link function
  • Residual Plot — Diagnoses fit; GLMs typically use deviance or Pearson residuals
  • Confidence Interval — Quantifies uncertainty in each estimated GLM coefficient