python-3.xpandaslinearmodels

How to get the interceipt from model summary in Python linearmodels?


I am running a panel reggression using Python linearmodels, something like:

import pandas as pd
from linearmodels.panel import PanelOLS
data = pd.read_csv('data.csv', sep=',')
data = data.set_index(['panel_id', 'date'])
controls = ['A','B','C']
controls['const'] = 1
model = PanelOLS(data.Y, controls, entity_effects= True)
result = model.fit(use_lsdv=True)

I really need to pull out the coefficient on the constant, but looks like this would not work

intercept = result.summary.const

Could not really find the answer in linearmodels' documentation on github More generally, does anyone know how to pull out the estimate coefficients from the linearmodels summary? Thank you!


Solution

  • result.params['const']

    would give the intercept, in general result.params gives the series of regression coefficients in linearmodels