* * Enders, Applied Econometric Time Series, 4th edition * Example from Section 7.11, pp 464-465 * Threshold unit root test * open data granger.xls cal(q) 1958:1 data(format=xls,org=columns) 1958:01 1994:01 date r_short r_10 * set spread = r_10-r_short * set ds = spread-spread{1} * @dfunit(maxlags=4,method=aic) spread * linreg ds # constant spread{1} ds{1} * @regreset(h=3) @regreset(h=4) * @EndersGranger(lags=1,attractor=constant) spread @EndersGranger(lags=1,attractor=constant,model=mtar) spread * * Nonlinear error correction model * set shigh = (spread{1}-1.64)*(ds{1}>=0) set slow = (spread{1}-1.64)*(ds{1}<0) * set dlong = r_10-r_10{1} set dshort = r_short-r_short{1} * disp "Non-Linear Error Correction Model" * linreg dlong # shigh slow dlong{1 2} dshort{1 2} exclude(title="Joint test for short-run long on long terms") # dlong{1 2} exclude(title="Joint test for short-run short on long terms") # dshort{1 2} * linreg dshort # shigh slow dlong{1 2} dshort{1 2} exclude(title="Joint test for short-run long on short terms") # dlong{1 2} exclude(title="Joint test for short-run short on short terms") # dshort{1 2} * * Linear error correction model * disp "Linear Error Correction Model" * linreg(define=ecteq) r_10 # constant r_short set ehat = %resids * linreg dlong # ehat{1} dlong{1 2} dshort{1 2} exclude(title="Joint test for short-run long on long terms") # dlong{1 2} exclude(title="Joint test for short-run short on long terms") # dshort{1 2} * linreg dshort # ehat{1} dlong{1 2} dshort{1 2} exclude(title="Joint test for short-run long on short terms") # dlong{1 2} exclude(title="Joint test for short-run short on short terms") # dshort{1 2}