Skip to content Skip to sidebar Skip to footer

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 stil

Solution 1:

was looking for an example and your was very helpful.

Only problem with your code seems to be using the same time index in

cov_kwds={'time': dat.index, 'groups': dat.index, 'maxlags': 11} 

Basically, it accounts every unique unit from dat.index as a separate group, in your case every quarter. At the same time it uses that year as a time indicator so your group exists of all observations in the same quarter with time lenght one quarter. Since your time variable is just one period for each group there are no lags involved thus the error.

Post a Comment for "Python Statsmodels Robust Cov_type='hac-panel' Issue"