[R-sig-ME] Fixing singularity in a generalized linear mixed effect model
Thierry Onkelinx
th|erry@onke||nx @end|ng |rom |nbo@be
Tue Mar 26 09:29:44 CET 2019
Dear Alessandra,
Your problem is hard to diagnose without the data. Can you make the data
available? Does the combination of factors lead to unique observations? Or
do some combinations have only zero's?
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be
///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////
<https://www.inbo.be>
Op wo 20 mrt. 2019 om 23:19 schreef Alessandra Bielli <
bielli.alessandra using gmail.com>:
> 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]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list