[R-sig-ME] Fwd: Fixing singularity in a generalized linear mixed effect model

Alessandra Bielli b|e|||@@|e@@@ndr@ @end|ng |rom gm@||@com
Thu Mar 21 21:43:07 CET 2019

Hi All

Sorry if I am reposting this, I am not sure it got sent to the list...

---------- Forwarded message ---------
From: Alessandra Bielli <bielli.alessandra using gmail.com>
Date: Wed, Mar 20, 2019 at 10:18 PM
Subject: Fixing singularity in a generalized linear mixed effect model
To: <r-sig-mixed-models using r-project.org>

Dear List

I am fitting this model using the lme4 package, in order to obtain catch
estimates using the predict function

m1 <- glmer(Count ~ CE + offset(log(Effort)) + (1|SetYear) +(1|Season) +
                  (1|Lance.N) + (1|Boat.Name) + (1|Observer.Name), data =
Data,                     glmerControl(optimizer = "bobyqa"), family=

where: CE is a categorical (control or treatment), Effort is numerical
(fishing effort), and all the other variables are random effects.

*My problem is that I get a warning message saying that the model is


Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
 Family: poisson  ( log )
Formula: Count ~ CE + offset(log(Effort)) + (1 | SetYear) + (1 |
    Season) + (1 | Lance.N) + (1 | Boat.Name) + (1 | Observer.Name)
   Data: Data
Control: glmerControl(optimizer = "bobyqa")

     AIC      BIC   logLik deviance df.resid
   148.6    174.3    -67.3    134.6      285

Scaled residuals:
    Min      1Q  Median      3Q     Max
-0.4852 -0.1758 -0.1339 -0.1227  3.5980

Random effects:
 Groups        Name        Variance  Std.Dev.
 Lance.N       (Intercept) 2.259e+00 1.503e+00
 Boat.Name     (Intercept) 0.000e+00 0.000e+00
 Observer.Name (Intercept) 0.000e+00 0.000e+00
 Season        (Intercept) 4.149e-17 6.442e-09
 SetYear       (Intercept) 0.000e+00 0.000e+00
Number of obs: 292, groups:
Lance.N, 146; Boat.Name, 21; Observer.Name, 5; Season, 4; SetYear, 4

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -2.5751     0.6612  -3.895 9.83e-05 ***
CEE          -0.5878     0.5003  -1.175     0.24
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
CEE -0.257
*convergence code: 0*
*singular fit*

I am aware that there are a lot of random effects and some of them have a
number of levels <5. However, this study was carried out under real fishery
conditions, so these random effects seemed all important to me.

I removed the random effects with variance zero as suggested here
until I removed them all and found myself with a glm instead.

My questions are

- why the variance of Lance.N, initially positive, becomes zero after I
remove the other random effects that had variance equal zero?
- is it acceptable to fit a glm just because all the random effect
variances were zero?

I hope I gave all the information you need.

Thanks for any advice!


	[[alternative HTML version deleted]]

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