[ADMB Users] Coding three-level hierarchical models in R...and more

H. Skaug hskaug at gmail.com
Mon Aug 16 06:25:27 PDT 2010


Richard,

> However, in actuality there are two nested factors. The data is nested in
> "SITE2", which are then nested in "LOCATION." In the R package lme4, for
> example, the coding would be random=~1|LOCATION/SITE. How would this be
> coded in glmm.admb?
>

glmm.admb only takes a single non-nested factor. This is not a limitation
of ADMB, but of the R-interface. We are thinking about extending
the interface.

>
> 3. I would like to compare two models that differ in their random effects:
>
> Model.slope<-glmm.admb(Y~X, random=~X, group="SITE", data=Data,
> family="nbinom", zeroInflation=TRUE)
>
> Model.intercept<-glmm.admb(Y~X, random=~1, group="SITE", data=Data,
> family="nbinom", zeroInflation=TRUE).
>
> I calculated the AIC of both models from the log-likelihood. The values are
> nearly identical. In fact, I have compared these two models for a variety of
> datasets and every single time, the AIC/-2log.lik values are nearly
> identical. This seems very fishy!

Not necessarily, if there is not random effect associated with X you
expect this.
Try to simulated data where beta_X varies with site, and you will
see that he loglik values will differ.

Hans



More information about the Users mailing list