Skip to content
Prev 10854 / 20628 Next

random slopes and intercepts using glmmadmb - negative binomial

Bayes Student <bayes.student at ...> writes:
The version of R and glmmADMB are more relevant than the version of
RStudio, for what it's worth.
[snip]

I think you're looking for species ~ year + (1|year) + (year|site) ,
equivalent to species ~ year + (1|year) + (1+year|site)

In the syntax (A|B), B is the *grouping variable* and A represents
the factor or factors that vary among groups.  The slight oddity
of this model is that year appears three times, once as a main effect
(the overall log-linear effect of year), once as a grouping variable
(the year-by-year variation across all sites around the log-linear
trend) and once as a random effect (the random variation of log-linear
trend among sites).