Help Needed for MixedLM Regression

Hi Everyone!

I am still learning Python and need your help for the Mixed Linear Model Regression code in Python. I am using the following code:

md = smf.mixedlm(“FBI ~ lninspec”, data, groups=data[“HD”])
mdf = md.fit()
print(mdf.summary())

Here FBI is my dependent variable, lninspec is my independent variable, and HD is my level.

My dependent variable FBI is a count variable. Therefore, I want to use the Poisson distribution option in this model. I would appreciate it if you help me in this respect.

Best wishes,

Moeen

What’s smf?

What does the documentation of smf.mixedlm say?

Sorry, I should have mentioned it.

import statsmodels.api as sm
import statsmodels.formula.api as smf

Are you referring to this function?

https://www.statsmodels.org/dev/generated/statsmodels.regression.mixed_linear_model.MixedLM.html

I’m afraid that your question requires more advanced statistics knowledge than I have.

You could try the statsmodels discussion group here:

https://groups.google.com/group/pystatsmodels

Thanks so much.