I am trying to do a mixed linear model for a dataset I am helping a colleague analyze, as in an earlier question I had posted, GLMs were unable to handle random effects.
With the appropriate imports and initialization of the data, the block of code that I have so far is:
mlm = sm.MixedLM(endog=data[physiology_cols[0]], \
exog=data[fixed_effects], \
groups=data[groups],)
mlm.fit()
However, I get back a LinAlgError: Singular matrix
.
Please pardon my ignorance (I'm not very well trained in stats) - but what would cause this error? Is it something about the data? Would it be the presence/absence of nan
s?