[R] Comparison of glm.nb and negbin from the package aod
sabwo
sabsiw at gmx.at
Thu Feb 10 19:00:51 CET 2011
I have fitted the faults.data to glm.nb and to the function negbin from the
package aod. The output of both is the following:
summary(glm.nb(n~ll, data=faults))
Call:
glm.nb(formula = n ~ ll, data = faults, init.theta = 8.667407437,
link = log)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.0470 -0.7815 -0.1723 0.4275 2.0896
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.7951 1.4577 -2.603 0.00923 **
ll 0.9378 0.2280 4.114 3.89e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for Negative Binomial(8.6674) family taken to be 1)
Null deviance: 50.28 on 31 degrees of freedom
Residual deviance: 30.67 on 30 degrees of freedom
AIC: 181.39
Number of Fisher Scoring iterations: 1
Theta: 8.67
Std. Err.: 4.17
2 x log-likelihood: -175.387
the output of the function negbin with a global dispersion parameter should
- when i understood it right - yield the same estimates as glm.nb. it does,
with slightly little differences.
> negbin(n~ll,~1, data=faults)
Negative-binomial model
-----------------------
negbin(formula = n ~ ll, random = ~1, data = faults)
Convergence was obtained after 112 iterations.
Fixed-effect coefficients:
Estimate Std. Error z value Pr(> |z|)
(Intercept) -3.795e+00 1.421e+00 -2.671e+00 7.570e-03
ll 9.378e-01 2.221e-01 4.222e+00 2.417e-05
Overdispersion coefficients:
Estimate Std. Error z value Pr(> z)
phi.(Intercept) 1.154e-01 5.56e-02 2.076e+00 1.895e-02
Log-likelihood statistics
Log-lik nbpar df res. Deviance AIC AICc
-8.77e+01 3 29 5.209e+01 1.814e+02 1.822e+02
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??
thanks for your help,
sabine
--
View this message in context: http://r.789695.n4.nabble.com/Comparison-of-glm-nb-and-negbin-from-the-package-aod-tp3299679p3299679.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list