Skip to content

Random effects in glmmADMB

2 messages · Kirsty E. B. Gurney, Joshua Wiley

#
Hi Kirsty,

I believe you are just missing parentheses.  What happens when you try:

amphs_zinb_bionull<-glmmadmb(VCAmphCountI~Zone + BPeriod +(1|Site),
data=Amphs, zeroInflation=TRUE, family="nbinom")

You may find these two pages I wrote helpful.  They do not deal with
zero inflated negative binomial models specifically, but they do show
various random effect poisson models among others in R in both
glmmadmb and glmer (from lme4):

## mixed effects poisson using packages lme4 and glmmADMB with
corresponding SAS and Stata code
## may be helpful for translating between packages
http://www.ats.ucla.edu/stat/r/pages/mepoisson.htm

## linear mixed models and generalized linear mixed models
## primarily used to simulate a data set so models are not the focus
http://www.ats.ucla.edu/stat/r/pages/mesimulation.htm

It is a bit anathema to say on this list, but you likely could also do
what you want using proc nlmixed.  I have written an example of how to
write out your own model and log likelihood function for a zero
inflated poisson model with random effects in proc nlmixed here:

http://www.ats.ucla.edu/stat/sas/faq/zip_nlmixed.htm

you could extent this to negative binomial without too much work.

Finally, it may be that once you have zero inflation and random
effects, you no longer have over dispersion and a poisson may be
sufficient (i.e., the negative binomial may be overkill once you have
everything else done).  Just a thought you might check out.

Cheers and good luck!

Josh

On Tue, Jun 19, 2012 at 6:29 PM, Kirsty E. B. Gurney
<kegurney at alaska.edu> wrote: