[R] Comparison of glm.nb and negbin from the package aod
Ben Bolker
bbolker at gmail.com
Fri Feb 11 14:48:45 CET 2011
sabwo <sabsiw <at> gmx.at> writes:
[big snip; comparing aod::negbin and MASS::glm.nb fits]
> The thing i really dont understand is why there is such a big difference
> between the deviances? (glm.nb = 30.67 and negbin=52.09?) Shouldnt they be
> nearly the same??
>
I don't have time to dig into this right now, but calculations of
log-likelihoods or deviances often drop additive constants (such as
the normalizing constant in a probability distribution), and different
implementations often make different choices about which constant
terms to include or not. If you dig around in the code you should
be able to find out which terms are included or not (although admittedly
this would be a nice thing to have included in the documentation). This
does make it hard to compare across fits in different packages. The important
thing (and the thing I'm fairly certain of, since I've used both packages
and they both seem to be well-written) is that the **differences** in
deviances when comparing models A and B both fitted in the same package
should be the same (because the additive constants that are included
or not cancel out in this case).
Ben Bolker
More information about the R-help
mailing list