[ADMB Users] negative binomial mixed model with crossed and random effects
Ben Bolker
bbolker at gmail.com
Wed Nov 23 05:09:51 PST 2011
On Tue, Nov 22, 2011 at 11:17 PM, Sharif S. Aly <saly at ucdavis.edu> wrote:
> Greetings,
> I am interested in RE variance estimates from a negative binomial mixed
> model. My model has a random intercept, no fixed effects, 4 random effects:
> time, collector, location, facility. RE location is nested in facility. Also
> RE location is crossed with time and collector. After studying several
> examples I came up with this syntax, is it correct:
>
> glmmadmb(formula = Counts ~ 1 + (1 | time) + (1 | collector) + (1 |
> facility) + (1 | facility:location), data = Data, family = "nbinom",
> link = "log")
>
> Coefficients:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) 1.952 0.356 5.49 4.1e-08 ***
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Number of observations: total=180, =3, =2, =4, =44
These numbers of levels (there is a bug in the assignment of names
here, which I'm
working on fixing) indicate that it's probably a little bit dicey to
fit random effects to
the time, collector, facility levels (fewer than 5 or 6 levels is
usually problematic:
see http://glmm.wikidot.com/faq )
> Random effect variance(s):
> $time
> (Intercept)
> (Intercept) 2.9696e-09
Note that this variance is effectively zero
>
> $collector
> (Intercept)
> (Intercept) 0.00047214
This one is four orders of magnitude less than the next largest (so
the sd is two
orders of magnitude less)
>
> $facility
> (Intercept)
> (Intercept) 0.26907
>
> $`facility:location`
> (Intercept)
> (Intercept) 1.352
>
> Negative binomial dispersion parameter: 1.379 (std. err.: 0.19336)
>
> Log-likelihood: -570.014
>
> If we think of r and p as the negative binomial parameters, how can I
> estimate "r" for such a complex dataset?
What do mean by r? The overdispersion parameter? Recent versions of
glmmADMB (at least) describe the parameterization of the NB in ?glmmadmb;
see above where it says "negative binomial dispersion parameter"
>
> I would also like to estimate P, would you agree that it can be estimated
> as:
>
> P =exponentiation of
> (intercept+RE_facility+RE_location+RE_collector+RE_time)
>
> Sharif
Yes, more or less. That should be RE_facility:location, shouldn't it?
Questions about glmmADMB should really go to the
r-sig-mixed-models at r-project.org
mailing list, because they are generally a little bit more R-specific ...
Ben Bolker
More information about the Users
mailing list