* * Enders, Applied Econometric Time Series, 4TH edition * Example from Section 7.6, pp 436-438 * Threshold model for money demand * open data taylor.xls calendar(q) 1979:2 data(format=xls,org=columns) 1979:02 2007:03 entry ffr_q pi rt_ygap * linreg ffr_q 1979:4 * # constant pi rt_ygap ffr_q{1} * summarize(title="Long-run response of interest rate to inflation") %beta(2)/(1-%beta(4)) * * To use the @ThreshTest procedure, you need to create the lagged series * as separate series. * set pilag1 = pi{1} set pilag2 = pi{2} set gaplag1 = rt_ygap{1} set gaplag2 = rt_ygap{2} * dofor thresh = pilag1 pilag2 gaplag1 gaplag2 @ThreshTest(trim=.15,thresh=thresh,nreps=100) ffr_q 1979:4 * # constant pi rt_ygap ffr_q{1} disp "Sum of Squared Residuals" @25 %rss disp "AIC" @25 -2.0*%logl+%nregsystem*2 disp "BIC" @25 -2.0*%logl+%nregsystem*log(%nobs) end dofor thresh * @ThreshTest(trim=.15,thresh=pilag2) ffr_q 1979:4 * # constant pi rt_ygap ffr_q{1} * linreg(smpl=pilag2>%%breakvalue) ffr_q 1979:4 * # constant pi rt_ygap ffr_q{1} linreg(smpl=pilag2<=%%breakvalue) ffr_q 1979:4 * # constant pi rt_ygap ffr_q{1}