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

Richard Feldman richard.feldman at mail.mcgill.ca
Fri Aug 13 12:50:47 PDT 2010


Hello,

I am new to ADMB and far from being a decent programmer. I wish to use 
ADMB in R as that is where I do all of my stats and simulations.

I have three basic questions:

1. I have coded the following model in R (windows Vista32):

Model.1<-glmm.admb(Y~1, random=~1, group="SITE", data=Data, 
family="nbinom", zeroInflation=TRUE)

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?

2. How do I extract the variance components in the above model; i.e. how 
much of the variation in Y occurs among LOCATIONs, among SITEs within 
LOCATION, and within SITE?

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!

Thank you all for taking the time in reading this and answering what I 
am sure are basic questions. Other than these issues, the program seems 
effortless to run.

Much appreciated!

-- 
Richard Feldman, PhD Candidate
Dept. of Biological Sciences, McGill University
W3/5 Stewart Biology Building
1205 Docteur Penfield
Montreal, QC H3A 1B1
514-212-3466
richard.feldman at mail.mcgill.ca



More information about the Users mailing list