RE : [R] Dispersion parameter in Neg Bin GLM

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 30 10:41:06 CEST 2005


This does not appear to be the same model as STATA.

Your model (as documented) has dispersion (var/mean) of 1 + phi*mu, so you 
need to constrain phi = a/mu to get a constant dispersion.  The output 
shown is not at all consistent with that.

On Thu, 30 Jun 2005, Lesnoff, Matthieu (ILRI) wrote:

> Edward, you also can use the package aod on CRAN, see the help page of 
> the function negbin.
>
> Best
>
> Matthieu
>
> An example:
>
>> library(aod)
>> data(dja)
>> negbin(y ~ group + offset(log(trisk)), ~group, dja, fixpar = list(4, 0))
>
> Negative-binomial model
> -----------------------
> negbin(formula = y ~ group + offset(log(trisk)), random = ~group,
>    data = dja, fixpar = list(4, 0))
> Convergence was obtained after 113 iterations.
> Fixed-effect coefficients:
>            Estimate Std. Error z value Pr(> |z|)
> (Intercept)  -0.5526     0.2277 -2.4267    0.0152
> groupTREAT   -1.0205     0.2598 -3.9287    < 1e-4
> Overdispersion coefficients:
>              Estimate Std. Error z value Pr(> z)
> phi.groupCTRL   0.8287      0.412  2.0117  0.0221
> Overdispersion coefficients set to fixed values:
>               Value
> phi.groupTREAT     0
> Log-likelihood = -121.149; nbpar = 3; df.residual = 72; Deviance = 111.826; AIC = 248.297

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list