2
$\begingroup$

having constructed a glm we can pass them through an anova as such:

anova(mnegbin1, mnegbin2, test = "Chisq")
Likelihood ratio tests of Negative Binomial Models

Response: count
                        Model    theta Resid. df    2 x log-lik.   Test    df      LR stat. Pr(Chi)
1 origin + substrate + sample 18.46502      1232       -2459.886                                   
2          substrate + sample 18.46502      1232       -2459.886 1 vs 2     0 -1.500666e-11       1

This gives us a comparison of the log likelihoods between the models, but can something similar be done for between residual deviances?:

summary(mnegbin1)
    Null deviance: 5686.16  on 1304  degrees of freedom
    Residual deviance:  890.24  on 1232  degrees of freedom

summary(mnegbin2)
    Null deviance: 5686.16  on 1304  degrees of freedom
    Residual deviance:  890.24  on 1232  degrees of freedom

In this instance they are of course identical but does that actually tell us anything?

$\endgroup$
2
  • $\begingroup$ Some details here stats.stackexchange.com/questions/283674/… $\endgroup$
    – user289381
    Commented Jul 10, 2020 at 11:37
  • 1
    $\begingroup$ Hi @RMM, one of your terms is a linear combination of the other, thats why the degree of freedom is the same. As I mentioned before, check the coefficients of your models, some of them are NA in the full model. $\endgroup$
    – StupidWolf
    Commented Jul 10, 2020 at 12:00

1 Answer 1

1
$\begingroup$

Comparing deviances and comparing log-likelihoods is exactly the same thing. The residual deviance is simply $-2$ $\times$ the log-likelihood with a suitable constant added so that it can't go negative. When you compare residual deviances between two models, the constant cancels out, so the deviance difference is exactly the same as the log-likelihood difference.

In your example you have simply fitted the same model twice (your origin variable is confounded with the other variables so it adds nothing), hence comparing the two models is entirely moot.

By the way, it would be helpful for readers to explain that you are using the MASS package in R. The MASS package defines a specific anova method for negative binomial glms, and the output style is slightly different to that of the usual anova method for glms.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.