[R-sig-ME] Attention Ben Bolker: Issues with glmer.nb() in R

Dominique Prinsloo domprinsloo at gmail.com
Tue Sep 27 21:27:20 CEST 2016

Hi Ben

I hope you are well. I have some issues regarding the structure of a GLMM
in R using the glmer.nb().

I have posted this question on Cross Validated at this link:

Here is the question and attached is a csv. file with a sample dataset.

I want to find out what variable affects the number of fish counts.
FishCounts is my response variable and it needs to be offset by the
InitialNumberPerQuadrat. I have three fixed effects that I want to test:
DaysSinceRelease, SizeRanking and SeededDensity or the interactions between
them. There are 18 sites and each Site was sampled up to 3 times (
SampleRound 1, 2 or 3) in the period of 600 days, therefore my random
variables need to take into account the repeated measures. The most
appropriate distribution for my response variable was the Negative Binomial
distribution as it had the lowest AIC value.

Firstly, should i use glmer() and then stipulate family=negative.binomial?
Or should I use glmer.nb()?

I have tried both ways but the glmer.nb() allows me to offset my variable
which is what I need to do. So have I structured the code correctly? Are
the random variables correct and do they account for the repeated measures?

model1 <- glmer.nb(FishCounts ~ DaysSinceRelease * SizeRanking *
SeededDensity + (1|Site)+(1|SampleRound),
offset(InitialNumberPerQuadrat),data = x))

When I run this code, I keep getting the following error: 'control' is not
a list; use glmerControl()?
Please help me as i'm getting desperate to figure this out.


More information about the R-sig-mixed-models mailing list