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

后端 未结 2 809
后悔当初
后悔当初 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).

提交回复
热议问题