Boundary (singular) fit in lmer

695 views Asked by At

I know this error has already been issued in stackoverflow, but the solution for the other questions doesn't seem to apply to my problem. I have a very simple model that predicts energy expenditure based on the number of days.

a<-lmer(energy ~ days + (1|PCBType), data = stp_summary_v1 )

and the model gives the warning:

boundary (singular) fit: see ?isSingular

I cannot share the data, but here is the distribution: enter image description here

What I've already tried without success:

  • a<-lmer(log(energy) ~ days + (1|PCBType), data = stp_summary_v1)
  • a<-lmer(scale(energy) ~ days + (1|PCBType), data = stp_summary_v1)
  • a<-lmer(log(energy) ~ log(days) + (1|PCBType), data = stp_summary_v1)
  • add more independent variables
  • change glmer() family
  • change the independent variable

Any idea why I keep getting this warning?

1

There are 1 answers

0
Robert Long On BEST ANSWER

With only two levels of PCBType, this variable should be a fixed effect.

By specifying it as random you are asking the software to estimate a variance for a normally distributed variable from only 2 observations, which of course does not make any sense and is almost certainly the cause of the singular fit.