Help Needed for MixedLM Regression

Skip to first unread message

Moeen Butt

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 =

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,


Reply all
Reply to author
0 new messages