Note that the calculation is specific to multiple step predictability regressions. It uses the residuals from a one-step regression to compute the covariance matrix for a k-step regression.
@OLSHodrick( options ) depvar start end
# list of explanatory variables
Options
STEPS=number of steps for the predictability regression
ONESTEP=one-step-ahead analogue to the <<depvar>>
EPS=one-step-ahead residuals
[PRINT]/NOPRINT
You must supply the STEPS option and either ONESTEP or EPS.
Example Program:
- Code: Select all
calendar(m) 1988:11
open data aluminum.xls
data(format=xls,org=columns) 1988:11 2007:05 pzalul pzalul3
*
set logspot = log(pzalul)
set logforw = log(pzalul3)
set ret3 = logspot{-3}-logspot
set ret1 = logspot{-1}-logspot
set xchange = logforw-logspot
*
* Linear regression of three step ahead returns with conventional standard errors
*
linreg ret3
# constant xchange
*
* Same with Hodrick standard errors. ONESTEP=RET1 provides the one step ahead returns
* for computing the one-step residuals.
*
@OLSHodrick(steps=3,onestep=ret1) ret3
# constant xchange
*
* And with Newey-West standard errors
*
linreg(lwindow=newey,lags=2) ret3
# constant xchange
Data file for example:
