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 =

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,


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?

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

You could try the statsmodels discussion group here:

Thanks so much.