Statistical Modeling, Statistical Analysis, Data Science, Data Analysis.
statsmodels.api as sm exog, endog = sm.add_constant(x), y mod = sm.GLM(endog, exog, family=sm.families.Poisson(link=sm.families.links.log)) res = mod.fit() endog (endogenous) and exog (exogenous) are how you call y and X in statsmodels. Notice you need to add the constant term to X. Without this,