[ADMB Users] Over-dispersed Mixed Effects Model Syntax in R
Ben Bolker
bbolker at gmail.com
Mon Oct 3 12:40:31 PDT 2011
On 11-10-04 08:50 PM, Dave Robichaud wrote:
> Hello admb'ers.
>
> I am having trouble interpreting the help files for glmm.admb in R.
>
> I had a perfectly good model in lmer:
>
> mCO1 = lmer(CO ~ Treat*Week + (1|Loc), family=poisson, data=dtr)
>
> But I now see that my data are overdispersed, so I do not think poisson
> is the appropriate family. I looked extensively on the web, and I see
> that lmer will not accept family = quasipoisson or family =
> negative.binomial. Thus, I am once again shopping around for an
> appropriate analysis.
If you want to stay with glmer, you can add an observation-level
random-effect:
>
dtr$obs <- seq(nrow(dtr))
mCO1 <- glmer(CO ~ Treat*Week + (1|Loc)+(1|obs),
family=poisson, data=dtr)
see the discussion on http://glmm.wikidot.com/faq for references etc.
for this approach.
> Now, I have stumbled upon the glmmADMB package, which claims to be more
> robust than glmmPQL. I like that nested models can be compared (e.g.,
> anova(fit2,fit)),
... this is the same as in lme4, for whatever that's worth ...
but can't figure out what "group" means, or how to
> write the syntax for my command.
>
> Can you help??
>
> I should describe my data in more detail. I have the following columns:
>
> Loc Treat Week CO
> 1 Control 1 10
> 2 Control 1 12
> 3 Control 1 0
> 4 Control 1 5
> 5 Modified 1 10
> 6 Modified 1 6
> 7 Modified 1 7
> 8 Modified 1 8
> 9 Modified 1 9
> 10 Modified 1 10
> 11 Modified 1 11
> 12 Modified 1 12
> 13 Modified 1 13
> ... (9 weeks of data omitted to save space)
> 1 Control 11 9
> 2 Control 11 8
> 3 Control 11 3
> 4 Control 11 6
> 5 Modified 11 9
> 6 Modified 11 6
> 7 Modified 11 5
> 8 Modified 11 10
> 9 Modified 11 2
> 10 Modified 11 4
> 11 Modified 11 6
> 12 Modified 11 9
> 13 Modified 11 2
>
> From this, you will see that I have 4 Control sites and 7
(do you mean 9?)
> Modified sites
> that are measured each week. All 13 locations have different names, and
> Location is a random variable. Location is a random variable.
>
> My main goal is to look for an effect of Treatment. But if there is a
> significant Week x Treatment interaction, I would examine the effect of
> Habitat separately for each Week.
>
mCO1 = glmm.admb(CO ~ Treat*Week, random=~1, group="Loc",
family="nbinom", data=dtr)
should I think do what you want.
You might also want to try
http://glmmadmb.r-forge.r-project.org/
for instructions on how to install the alpha version (which is more
flexible, although it is also slower for the cases it can handle).
You might want to consider making Week a random variable as well ... it
adds complexity, but it would be my guess at the most sensible model
(i.e. you are unlikely to care about this specific set of weeks, but
rather about the among-week variation in treatment effects). This can
be dealt with in glmer and in glmmADMB "alpha" but not in glmmADMB
"classic".
> Hopefully, the above helps to clarify my situation.
>
> Thanks very much
>
> Dave
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
More information about the Users
mailing list