Likelihood ratio test
Models and regression · reference distribution: χ²(df)
When to use it
Compare two nested models fitted by maximum likelihood, as in a logistic regression.
Null hypothesis
The smaller model is enough.
Assumptions
- Nested models
- Large sample
Test statistic
G^2 = 2\left(\ell_{\text{full}} - \ell_{\text{reduced}}\right)Effect size
McFadden’s pseudo-R², compared with the intercept-only model.
R^2_{\text{McF}} = 1 - \dfrac{\ell_{\text{full}}}{\ell_{\text{null}}}How to report it
G²(2) = 9.8, p = .007
In R and Python
R
anova(reduced, full, test = "LRT")
Python
G2 = 2 * (full.llf - reduced.llf)
p = stats.chi2.sf(G2, full.df_model - reduced.df_model)
In Python, stats is scipy.stats and np is numpy.
Variants and alternatives
- Wald and score, approximations of the same test
Where it sits in the catalog
Models and regression. Tests run inside a fitted model: whether a coefficient matters, whether the model explains anything and whether the residuals meet the assumptions.
In the decision tree
- What do you want to do? Test a regression model
- What do you want to test? Whether a larger model is worth it over a smaller one
It also appears alongside other tests:
- As an alternative to Wald.