- Introduced by
- John A. Nelder & Robert W. M. Wedderburn
- Year
- 1972
- Type
- Regression framework
- Family
- Regression / GLM
What does it do?
The Generalized Linear Model is a unified regression framework that extends ordinary linear regression to outcomes from the exponential family — including binary, count, proportion, and continuous positive outcomes.
A link function connects the linear predictor to the mean of the response, enabling principled modelling beyond the Gaussian case.
The intuition behind the method
Think of GLM as a switchboard: you pick the distribution that best matches your outcome type (Gaussian for continuous, Binomial for binary, Poisson for counts), then pick a link function (identity, logit, log) that maps the linear predictor to the correct scale for that distribution. The parameters are the same linear combination of predictors as in OLS, but the model no longer forces the response to be normally distributed, removing a major restriction in applied work.
History
Nelder and Wedderburn (1972), in the Journal of the Royal Statistical Society: Series A, showed that maximum likelihood estimates can be obtained by iterative weighted linear regression for observations from an exponential family whose systematic effects are made linear by a suitable transformation. Their paper placed the Normal, Binomial (including probit analysis), Poisson (contingency tables) and gamma distributions within one class defined by a distribution, a linear predictor and a link function. McCullagh and Nelder's book (second edition, 1989) is a standard book-length treatment of the framework.
When to use it
Use GLM whenever the outcome variable is not continuous and unbounded: binary outcomes (logistic GLM), event counts (Poisson or negative-binomial GLM), proportions constrained to [0,1] (binomial with logit/probit), or strictly positive continuous data with right-skew (Gamma or inverse-Gaussian GLM). GLM is appropriate when the relationship between predictors and the mean response is best captured on a transformed scale and when the variance-mean relationship follows the chosen family. Prefer OLS only when the Gaussian assumption is defensible. Do not use a single GLM when the data have clustered or hierarchical structure (use mixed-effects extensions) or when the number of events is very small relative to the number of predictors. With few events, estimates become unstable and separation, where a predictor or combination of predictors perfectly separates the outcomes, can occur; in that case the model should be simplified or its estimates treated with caution.
Limitations and considerations
- Requires the user to correctly specify both the distribution family and the link function; misspecification can bias inference.
- Standard GLM assumes independence of observations and does not accommodate clustered, repeated-measures, or hierarchical data without extensions (GEE or mixed-effects GLM).
- Maximum-likelihood standard errors rely on asymptotic theory and may be unreliable with small samples or rare events.
- Does not automatically handle overdispersion in count data (Poisson family); a negative-binomial or quasi-Poisson model is then preferable.
- Non-linear link functions make raw coefficients less immediately intuitive than OLS slopes; marginal effects or back-transformation is often required for communication.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Unifies many regression models — logistic, Poisson, Gamma, and others — under one coherent framework with shared theory and software.
- The link function and distributional assumption are chosen to match the outcome type, giving better-calibrated predictions and more valid standard errors than OLS on non-Gaussian data.
- Maximum-likelihood estimation provides well-characterised asymptotic inference (Wald, likelihood-ratio, and score tests).
- Model fit is assessed through deviance and AIC, enabling principled model comparison and selection.
- Coefficients on the link scale have straightforward interpretations (e.g., log-odds ratios for logistic, rate ratios for Poisson).
- Computationally efficient via IRLS and available in every major statistical package.
Applications
- Medical research: modelling binary disease outcomes (logistic GLM) or time-to-event rates (Poisson GLM with offset).
- Ecology: modelling species counts with Poisson or negative-binomial GLM, accounting for effort via an offset term.
- Insurance and finance: Gamma GLM for modelling strictly positive claim amounts or durations.
- Social science: logistic or probit GLM for binary survey responses such as voting behaviour or employment status.
- Epidemiology: log-binomial or Poisson GLM to estimate risk ratios directly from cohort study data.
- Marketing analytics: modelling purchase counts or conversion rates using count-data or binomial GLMs.
How it works
How it works
A linear predictor η = Xβ is formed as the inner product of predictors and unknown coefficients, exactly as in ordinary regression. This is the core structural equation shared across all GLM members.
Formula
\eta_i = \mathbf{x}_i^{\top}\boldsymbol{\beta}A link function g connects the linear predictor to the conditional mean of the response via g(μ) = η, or equivalently μ = g⁻¹(η). Common choices are the identity link for Gaussian, the logit link for Binomial, and the log link for Poisson outcomes.
Formula
g(\mu_i) = \eta_i
The response variable is assumed to follow a distribution from the exponential family, such as Normal, Binomial, Poisson, Gamma, or Inverse Gaussian, parameterized by its mean μ and a dispersion φ. This distributional assumption determines how variance relates to the mean: Var(Y_i) = φ V(μ_i), where V is the family-specific variance function. For example, V(μ) = μ for Poisson, V(μ) = μ(1−μ) for Binomial, and V(μ) = μ² for Gamma. The dispersion φ is fixed at 1 for Poisson and Binomial models and is estimated for Gaussian and Gamma models.
Formula
Y_i \sim \text{ExponentialFamily}(\mu_i,\,\phi)Coefficients are estimated by maximum likelihood rather than least squares. The log-likelihood from the chosen exponential-family distribution is maximised with respect to β, yielding consistent and asymptotically normal estimates under standard regularity conditions.
Formula
\hat{\boldsymbol{\beta}} = \arg\max_{\boldsymbol{\beta}}\, \ell(\boldsymbol{\beta};\,\mathbf{y})Maximisation is carried out by iteratively reweighted least squares (IRLS). The technique of iterative weighted linear regression, described by Nelder and Wedderburn (1972), yields maximum likelihood estimates for exponential-family observations. At each iteration a working response z_i = η_i + (y_i − μ_i)(dη_i/dμ_i) and working weights w_i = (dμ_i/dη_i)² / Var(Y_i) are computed from the current fit, with Var(Y_i) = φ V(μ_i). The coefficients are then updated by solving the weighted least-squares problem β(t+1) = (XᵀWX)⁻¹XᵀWz, where W is the diagonal matrix of working weights; a constant dispersion φ cancels from this update. The method is Fisher scoring, which uses the expected information rather than the observed Hessian; for canonical links the two coincide, so the update is a Newton-type step in that case.
Common pitfalls
- Fitting a Poisson GLM to count data without checking overdispersion (variance well above the mean). The Poisson variance assumption is then violated, and the reported standard errors and p-values are unreliable; when variance exceeds the mean they are typically too small. Check the Pearson dispersion statistic and compare Poisson with negative-binomial models (AIC or a dispersion test) before interpreting results.
- Using the Gaussian family with an identity link on binary data: OLS on a 0/1 outcome can yield predicted probabilities outside [0,1]. Use Binomial-logit instead.
- Ignoring the scale of the link function when interpreting coefficients: a coefficient of 0.5 in a log-link Poisson model means a multiplicative effect of e^0.5 ≈ 1.65 on the count, not an additive effect.
- Treating GLM deviance like OLS R²: deviance reduction relative to a null model is informative but pseudo-R² measures differ across families and should not be compared across different family choices.
- Applying a standard GLM to clustered or longitudinal data ignores within-cluster correlation, inflating Type I error rates; use GEE or mixed-effects GLM in those settings.
Frequently asked questions
What is the difference between GLM and OLS?
OLS is the special case of GLM with a Gaussian (normal) distribution and an identity link. GLM generalises this by allowing other exponential-family distributions and link functions, making it suitable for binary, count, and other non-Gaussian outcomes where OLS assumptions are violated.
How do I choose the right family and link function?
Match the family to the data-generating process: Binomial for binary or proportion outcomes, Poisson or negative-binomial for counts, Gamma for strictly positive continuous data with right skew, and Gaussian for symmetric continuous outcomes. The canonical link (logit, log, inverse, identity) is the default and is usually the natural starting point. Non-canonical links on the Binomial family, such as the log link for risk ratios, can be used, but these fits may fail to converge or produce fitted probabilities above 1, so convergence and fitted values should be checked before results are reported.
What is deviance in a GLM?
Deviance measures how much the fitted model's log-likelihood falls short of the saturated (perfect-fit) model's log-likelihood, scaled by two: D = 2(ℓ_sat − ℓ_fitted). Smaller deviance means better fit. Differences in deviance between nested models are used for likelihood-ratio tests. The chi-squared reference distribution is an asymptotic approximation and does not hold exactly for every family; for models with an estimated dispersion parameter, such as the Gaussian, an F-test is commonly used instead.
What is overdispersion and how do I handle it?
Overdispersion occurs when the observed variance in count or proportion data exceeds what the assumed distribution predicts — common with Poisson models for heterogeneous populations. Remedies include switching to a negative-binomial family, using quasi-likelihood with a dispersion parameter, or fitting a zero-inflated model if excess zeros are present.
Can GLM handle longitudinal or clustered data?
Standard GLM assumes independent observations and is not appropriate for clustered or repeated-measures data without modification. The two main extensions are Generalized Estimating Equations (GEE), which targets population-averaged effects, and mixed-effects GLM (GLMM), which models subject-specific random effects.
Related methods
Sources
Nelder, J. A., & Wedderburn, R. W. M. (1972). Generalized linear models. Journal of the Royal Statistical Society: Series A (General), 135(3), 370–384.
Open DOI referenceMcCullagh, P., & Nelder, J. A. (1989). Generalized Linear Models (2nd ed.). Chapman and Hall/CRC.
ISBN: 978-0412317606