# Solved – Likelihood ratio test on a single model

If i were To perform a likelihood ratio test where I compare two models A and B I would basically try to find out which of these models are the better one of these models fits the data best. But if i were to perform a LR test on only one of these models, what am i actually trying to find out? and by that i mean, what is the Null hypothesis? is it something in the line of H0: "the model fits data well"?

Contents

SmallChess is right when they say you can't do an LRT with a single model.

However, you can compare your model to an intercept only model, which would be equivalent to testing if all the coefficients except the intercept are 0.

(As an aside, you could specify that all coefficients, including the intercept, are 0, but this is not usually done).

Under this perspective, the null hypothesis remains unchanged; you are still determining if the change in log-likelihood by regressing your outcome onto your covariates is more different than would be expected if the covariates were not actually informative (note that the likelihood can ALWAYS be made smaller, even when the covariates are truly not informative). More concretely,

$$H_0: beta_i = 0 text{ for all covariates } x_i$$

$$H_A: exists beta_jneq 0 text{ for some covariate } x_j$$.

Here is an example. I'll create a linear regression where the coefficients are all 0, except the intercept.

``set.seed(0) library(tidyverse)  d = data_frame(   x1 = rnorm(100),   x2 = rnorm(100) )  X = model.matrix(~ ., data = d)  d\$y = X%*% c(1,0,0) + rnorm(100)  model = glm(y~., data = d) model_null = glm(y~1, data = d) anova(model_null,model, test = 'LRT')   Analysis of Deviance Table  Model 1: y ~ 1 Model 2: y ~ x1 + x2   Resid. Df Resid. Dev Df Deviance Pr(>Chi) 1        99     88.533                      2        97     86.211  2    2.322   0.2708 ``

We fail to reject the null because the change in likelihood (in this case deviance because I used the glm command) is not large enough.

Note that when I change one of the coefficients to a non-zero number

``d\$y = X%*% c(1,0,1) + rnorm(100)  model = glm(y~., data = d) model_null = glm(y~1, data = d) anova(model_null,model, test = 'LRT') Analysis of Deviance Table  Model 1: y ~ 1 Model 2: y ~ x1 + x2   Resid. Df Resid. Dev Df Deviance  Pr(>Chi)     1        99     203.36                           2        97     118.14  2   85.219 6.406e-16 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ``

We reject the null because the resulting change in likelihood (again, here it is deviance) is larger than chance would allow at the 0.05 level.

Rate this post