# GLM tests involving deviance and likelihood ratios

I'm a little confused about the different common tests for GLMs.

There is the null deviance, which is similar to a likelihood ratio for the difference between the saturated model and the model with only an intercept.

There is the residual deviance, which is similar to a likelihood ratio for the difference between the saturated model and the current fitted model.

Given these,

1. It seems to me that you can use the difference in residual and null deviance, which should follow a Chi-square distribution, to give something analogous to the F-test in regression, is this correct?

2. You can test the residual deviance itself, as it allows you to determine goodness of fit?

3. I'm assuming there is no test involving the null deviance alone

4. Unrelated to deviances, you can do likelihood ratio tests comparing for example a model with all parameters and a model lacking one of them?

R just outputs the null deviance and the residual deviance along with their degrees of freedom, so I assume the point is that you can use them to do the tests mentioned above.

If someone can elaborate (on a basic level) I would really appreciate it, because I'm really getting confused as to what the GLM tests make use of in terms of deviance etc.. And if I missed any tests please let me know as well.

The confusion probably comes from the fact that there are three models involved, and the term "deviance" refers to twice the log or the likelihood ratio between two of them. The models are:

1. Null model (usually a model with only an intercept term, no influence of explanatory variables on response),
2. GLM of interest, modelling the response by a linear combination of the explanatory variables (connected by the link function), and
3. saturated model, in which the expected value of the response cam freely depend on the values taken by the explanatory variables.

The residual deviance $$D$$ is defined as twice the log of the likelihood ratio between the saturated model and the GLM. The null deviance $$D_0$$ is twice the log of the likelihood ratio between the saturated model and the null model. From this it follows that $$D-D_0$$ is twice the log of the likelihood ratio between the GLM and the null model, and in fact you can compare any two models of different complexity nested in each other (i.e., where all parameters/explanatory variables of the less complex model also occur in the more complex model) by using the difference of their deviances (note that the log of the likelihood ratio is in fact a difference between log-likelihoods, and this means that if you compute a difference between deviances, the terms belonging to the saturated model cancel out).

All these statistics as logs of likelihood ratios are $$\chi^2$$-distributed under standard assumptions, with degrees of freedom as the diufference between the numbers of parameters of the involved models.