Help Needed for MixedLM Regression

50 views
Skip to first unread message

Moeen Butt

unread,
Apr 20, 2022, 8:04:16 AM4/20/22
to pystatsmodels

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

Reply all
Reply to author
Forward
0 new messages