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:
import statsmodels.api as sm
import statsmodels.formula.api as smf
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 include the Poisson family in this code.
Best wishes,
Moeen