Python statsmodels robust cov_type='hac-panel' issue
问题 I hope this is the right place for my question. I would like to understand how to use the 'hac-panel' cov_type when running sm.OLS. I have struggled with it the whole day but still cannot figure it out. Here is an example of my code (with data): import pandas as pd import statsmodels.api as sm import statsmodels.formula.api as smf from pandas.tseries.offsets import * # Just grabbing some random data here dat = sm.datasets.macrodata.load_pandas().data dat['time'] = dat['year'].apply(lambda x: