0

I do have a complex linear mixed effect model.

model_lme = MixedLM.from_formula("Ratings ~ LCDev455*ST0LT1*TargetType*Female0Male1", groups=data["ResponseID"], data=data)
model_lme = model_lme.fit()
model_lme.summary()

This perfectly works in R, lmerTest. Not even a convergence warning. But in python statsmodels, it gives the error: Singular matrix.

I thought that these two packages (lmerTest in R, lme in Python) were giving the same output.

Does anyone have any idea why this might happen? I am more of a beginner so I cannot really simulate my data here.

Thank you!

semchena31
  • 51
  • 1
  • 7
  • In the absence of a reproducible example we probably can't answer this question. Is there any chance you can share your data? – Ben Bolker Jan 18 '21 at 15:07
  • Ok, you are right, it is a research data and I am not sure if i am allowed to upload it now. I will try to find out how to create a similar dataset. – semchena31 Jan 18 '21 at 15:35
  • Did you check whether the R version doesn't drop automatically some variables or imposes some restrictions to make the model estimable? – Josef Jan 18 '21 at 18:20

0 Answers0