I'm running a linear fit model using the lme4 package in R and the following code keeps coming up with the error

boundary (singular) fit: see ?isSingular

Can someone please help?

m1= lmer (elo ~  weight1 + bogirth1 + negirth1 + age + fight +
    (1|id) + (1|year) ,  data = datause)

The data is based on fallow deer fights and body condition during the rutting season.

  • 2
    $\begingroup$ What's your sample size? And how many levels for your grouping variables year and id? A singular fit might indicate that your random effects are too complex for your data to support. Bayesian models, e.g. with R package brms (which also uses lme4 syntax), can sometimes help with this, as they provide some regularisation to facilitate estimation $\endgroup$
    – Lachlan
    Mar 4, 2021 at 13:08
  • $\begingroup$ What did you learn when you typed ?isSingular as suggested by the message? The "Details" section of the resulting help page is helpful and clear. $\endgroup$
    – whuber
    Mar 4, 2021 at 14:40

1 Answer 1


In this case it is likely that the variance component for either id or year is estimated at, or close to, zero. Without further details of your study and data it is difficult to be sure, but I would imagine that the culprit will be year. If you expect a year effect then you should include it as a fixed effect instead. If you have a small number of years, then this would be a further reason to exclude it as a grouping factor for random intercepts.

I note you also include age in your model, so there could be an issue with collinearity between age and year, so that is something else to bear in mind. You might want to investigate "age-period-cohort" analysis for further details on that.

  • $\begingroup$ @Shannon Does this answer your question ? If so then please consider marking it as a the accepted answer and (if you haven't already) upvoting it. If not, please could you let us know why so that it can be improved $\endgroup$ Jun 4, 2021 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.