I guess you are using a pandas DataFrame as the data to OLS. In this
case several or most of the results are wrapped again in pandas
DataFrames or Series.
solution is to
either use the shift/lag features for pandas series to get the lagged residuals,
or to use the slicing as you have it with numpy ndarrays, e.g. with
old_resid.values
Another way that we use internally is to access the results without
wrapping which returns ndarrays. The unwrapped results instance is
available as `_results` attribute.
results = OLS(....).fit()
raw_results = results._results
raw_results.resid
Josef
>
> Thanks