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

Alessandra Bielli b|e|||@@|e@@@ndr@ @end|ng |rom gm@||@com
Wed Mar 20 23:18:45 CET 2019


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=
"poisson")


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
singular*

*>summary(m1)*

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:
    (Intr)
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
https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#singular-models-random-effect-variances-estimated-as-zero-or-correlations-estimated-as---1
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!

Alessandra

	[[alternative HTML version deleted]]



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