Course contentsShow
← Data Science
Lesson 699 of 2,14518. Generalized Linear ModelsFree lesson

The Likelihood Ratio Test

Using differences in deviance to perform likelihood ratio tests for comparing nested GLMs.

The Likelihood Ratio Test

What you'll learn: How to use differences in deviance to compare nested GLMs and decide if additional predictors significantly improve your model.

The Core Idea

You've learned that deviance measures how well a GLM fits your data. Now you can use that to answer: "Does adding more predictors meaningfully improve the model?"

The Likelihood Ratio Test compares two nested models—where one model (the simpler one) is a special case of the other (the more complex one). The test statistic is simply the difference in deviance between them.

How It Works

  1. Fit your null (simpler) model and record its residual deviance
  2. Fit your alternative (more complex) model and record its residual deviance
  3. Calculate: LR statistic = Deviance(null) - Deviance(alternative)
  4. Under the null hypothesis (extra predictors don't help), this statistic follows a chi-squared distribution with degrees of freedom equal to the difference in the number of parameters

If the LR statistic is large enough (low p-value), the additional predictors significantly improve fit.

An Analogy

Think of deviance as "unexplained error." The likelihood ratio test asks: "Did adding those extra predictors reduce the unexplained error by more than you'd expect from random chance?"

When to Use It

  • Comparing nested GLMs (logistic regression, Poisson regression, etc.)
  • Deciding whether interaction terms or polynomial features are worth including
  • Formal hypothesis testing for model selection alongside AIC/BIC

Key Takeaway: The Likelihood Ratio Test uses the difference in deviance between nested models, compared against a chi-squared distribution, to formally test whether additional predictors significantly improve model fit.