Português

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

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

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

  1. What do you want to do? Test a regression model
  2. What do you want to test? Whether a larger model is worth it over a smaller one

It also appears alongside other tests:

Open the decision tree