How to cope with a singular fit in a linear mixed model (lme4)?

后端 未结 2 810
后悔当初
后悔当初 2021-02-09 16:15

I am running several linear mixed models for an study about birds with the variable nest as a random variable. The thing is that in some of these models I get what is called \'s

相关标签:
2条回答
  • 2021-02-09 16:54

    In lmer, a singular fit could be caused by collinearity in fixed effects, as in any other linear model. That would need you to revise your model by removing terms. But in lmer, that (or a "boundary (singular) fit" warning) can also be also triggered in quite simple models when a random effect variance is estimated very near zero and (very loosely) the data is not sufficiently informative to drag the estimate away from the zero starting value.

    The formal answer is broadly similar either way; drop terms that estimate as zero. And that remains sensible at least until you know which term is causing the problem. But there are times when a negligible variance is reasonably likely but you'd like to retain it in the model; for example because you're quite deliberately looking for intervals on possibly small variances or maybe doing multiple similar experiments and would prefer to extract all the variances consistently. If you're sure of what's going on, you can suppress these warnings via lmerControl, which can be set not to use the relevant tests. For example, you can include

    control=lmerControl(check.conv.singular = .makeCC(action = "ignore",  tol = 1e-4))
    

    in your lmer call. That leaves in the default tolerance (which makeCC needs) but suppresses the singular fit test. (The default is action="warning", which runs the test and issues the warning).

    0 讨论(0)
  • 2021-02-09 17:04

    Are you actually interested in whether each of the fixed effects in your model has an effect? For example, age or sex may explain some of the variation, but perhaps you could include it as a random effect rather than a fixed effect. Changing it to a random effect (if that is rational) might address the over dispersion issue.

    My interpretation of the singularity issue, which certainly could be incorrect, is that each of the combinations of your model only has one observation/measurement. Therefore, you may not have enough observations to include all of those variables as fixed effects.

    0 讨论(0)
提交回复
热议问题