*@M_TAR series start end resids * * Computes the Momentum-TAR unit root test. References: * Enders, W. and Granger C.W.J (1998), "Unit-root Tests and Asymmetric Adjustment with an Example Using * the Term Structure of Interest Rates", Journal of Business and Economic Statistics, 16, 304-311 * Enders, W.(2001) "Improved critical values for the Enders-Granger unit-root test", Applied Economic * Letters, 8, 257-261 * * Options: * Model=[MTAR]/TAR; This determines whether the Threshold Autoregressive or Momentum-TAR unit root * test is computed * LAGS=number of additional lags [0] ; LAGS indicates the degree of AR polynomial on the differences * to include in the regressions * Method=[CONSISTENT]/KNOWN; These determine whether a consistent estimate as of Chan's method (1993) * or the sample mean are used for estimation of the threshold. * * The procedure offers the possibility of saving the residuals for diagnostic checking. * * * Sept.2005, Written by: Walter Enders and Razvan Pascalau, University of Alabama * rpascala@cba.ua.edu * * procedure M_TAR series1 start end resids type series series1 *resids type integer start end * option choice model 1 MTAR TAR option choice method 1 consistent known option integer lags 0 * local series y yy dy dyy resids local integer v1 v2 nobs local rectangular[real] known consistent knownt consistentt * inquire(series=series1) v1>>start v2>>end * DIMENSION Known(3,13) Consistent(3,13) Knownt(3,4) Consistentt(3,13) * critical values at 90%, 95%, 97.5%, 99% (table 1 & 2 p. 259) compute Known = || 50 , 4.21 , 5.19 , 6.15 , 7.55 $ | 100 , 4.11 , 5.04 , 5.96 , 7.10 $ | 250 , 4.08 , 4.97 , 5.83 , 6.91 $ || compute Consistent = || 50 , 5.02 , 6.05 , 7.09 , 8.59 $ | 100 , 4.81 , 5.77 , 6.73 , 7.99 $ | 250 , 4.70 , 5.64 , 6.51 , 7.64 $ || compute Knownt = || 50 , 3.27 , 4.08 , 4.91 , 6.07 $ | 100 , 3.18 , 3.95 , 4.72 , 5.76 $ | 250 , 3.09 , 3.82 , 4.54 , 5.51 $ || compute Consistentt = || 50 , 5.15 , 6.19 , 7.25 , 8.64 $ | 100 , 5.08 , 6.06 , 6.93 , 8.19 $ | 250 , 5.11 , 6.03 , 6.88 , 8.04 $ || * if model.eq.2 { * if method.eq.2 { linreg(noprint) series1 v1 v2 y ; # constant ; *demean the series dis 'Threshold = ' %beta set flag = %if(y{1}<0,0,1) set yplus = flag*y{1} set yminus = (1-flag)*y{1} * dif y v1+1 v2 dy if lags { linreg dy v1+lags+1 v2 resids ; # yplus yminus dy{1 to lags} } else { linreg dy v1+1 v2 resids ; # yplus yminus } display display 'TAR Unit Root Test, Series' %l(series1) display 'Regression Run From' %datelabel(v1+lags+1) 'to' %datelabel(v2) * exclude # yplus yminus display '---------------------------------------------------------' display ' With known threshold ' display '---------------------------------------------------------' compute f = %cdstat compute nobs = %nobs + 1 display 'critical values at' @20 '90%' @28 '95%' @36 '97.5%' @44 '99%' if nobs<100 display @3 'for 50 obs.' @19 #.## knownt(1,2) @27 #.## knownt(1,3) @36 #.## knownt(1,4) $ @43 #.## knownt(1,5) if nobs>100.and.nobs<250 display @3 'for 100 obs.' @19 #.## knownt(2,2) @27 #.## knownt(2,3) @36 #.## knownt(2,4) $ @43 #.## knownt(2,5) if nobs>250 display @3 'for 250 obs.' @19 #.## knownt(3,2) @27 #.## knownt(3,3) @36 #.## knownt(3,4) $ @43 #.## knownt(3,5) * now test rho1 = rho2 display '-----------------------------------------------------------------------' display 'Perform the test for symmetric adjustment(rho1=rho2)' restrict 1 # 1 2 # 1 -1 0 } else if method.eq.1 { compute rss_test = 1000000.0 set thresh_test = series1 order thresh_test compute low = v1 + fix(%nobs*.15), high = v2 - fix(%nobs*0.15) * compute thresh = thresh_test(low) do ii = low,high set yy = series1 - thresh_test(ii) dif yy v1+1 v2 dyy set flag = %if(yy{1}<0,0,1) set y_plus = flag*yy{1} set y_minus = (1-flag)*yy{1} linreg(noprint) dyy v1+1 v2 # y_plus y_minus if %rss < rss_test { compute rss_test = %rss compute thresh = thresh_test(ii) } end do ii dis 'Threshold = ' thresh * set yy = series1 - thresh set flag = %if(yy{1}<0,0,1) set y_plus = flag*yy{1} set y_minus = (1-flag)*yy{1} * dif yy v1+1 v2 dyy if lags { linreg dyy v1+lags+1 v2 resids ; # y_plus y_minus dyy{1 to lags} } else { linreg dyy v1+1 v2 resids ; # y_plus y_minus } display display 'TAR Unit Root Test, Series' %l(series1) display 'Regression Run From' %datelabel(v1+lags+1) 'to' %datelabel(v2) exclude # y_plus y_minus display '---------------------------------------------------------' display ' With consistent threshold ' display '---------------------------------------------------------' compute f = %cdstat compute nobs = %nobs + 1 display 'critical values at' @20 '90%' @28 '95%' @36 '97.5%' @44 '99%' if nobs<100 display @3 'for 50 obs.' @19 #.## consistentt(1,2) @27 #.## consistentt(1,3) @36 #.## consistentt(1,4) $ @43 #.## consistentt(1,5) if nobs>100.and.nobs<250 display @3 'for 100 obs.' @19 #.## consistentt(2,2) @27 #.## consistentt(2,3) @36 #.## consistentt(2,4) $ @43 #.## consistentt(2,5) if nobs>250 display @3 'for 250 obs.' @19 #.## consistentt(3,2) @27 #.## consistentt(3,3) @36 #.## consistentt(3,4) $ @43 #.## consistentt(3,5) * now test rho1 = rho2 display '-----------------------------------------------------------------------' disply 'Perform the test for symmetric adjustment(rho1=rho2)' restrict 1 # 1 2 # 1 -1 0 } } else if model.eq.1 { if method.eq.2 { linreg(noprint) series1 v1 v2 y ; # constant ; *demean the series dis 'Threshold = ' %beta dif y v1+1 v2 dy set flag = %if(dy{1}<0,0,1) set yplus = flag*y{1} set yminus = (1-flag)*y{1} * if lags { linreg dy v1+lags+1 v2 resids ; # yplus yminus dy{1 to lags} } else { linreg dy v1+1 v2 resids ; # yplus yminus } display display 'M-TAR Unit Root Test, Series' %l(series1) display 'Regression Run From' %datelabel(v1+lags+1) 'to' %datelabel(v2) * exclude # yplus yminus display '---------------------------------------------------------' display ' With known threshold ' display '---------------------------------------------------------' compute f = %cdstat compute nobs = %nobs + 1 display 'critical values at' @20 '90%' @28 '95%' @36 '97.5%' @44 '99%' if nobs<100 display @3 'for 50 obs.' @19 #.## known(1,2) @27 #.## known(1,3) @36 #.## known(1,4) $ @43 #.## known(1,5) if nobs>100.and.nobs<250 display @3 'for 100 obs.' @19 #.## known(2,2) @27 #.## known(2,3) @36 #.## known(2,4) $ @43 #.## known(2,5) if nobs>250 display @3 'for 250 obs.' @19 #.## known(3,2) @27 #.## known(3,3) @36 #.## known(3,4) $ @43 #.## known(3,5) * now test rho1 = rho2 display '-----------------------------------------------------------------------' disply 'Perform the test for symmetric adjustment(rho1=rho2)' restrict 1 # 1 2 # 1 -1 0 } else if method.eq.1 { compute rss_test = 1000000.0 set thresh_test = series1 order thresh_test compute low = v1 + fix(%nobs*.15), high = v2 - fix(%nobs*0.15) * compute thresh = thresh_test(low) do ii = low,high set yy = series1 - thresh_test(ii) dif yy v1+1 v2 dyy set flag = %if(dyy{1}<0,0,1) set y_plus = flag*yy{1} set y_minus = (1-flag)*yy{1} linreg(noprint) dyy v1+1 v2 # y_plus y_minus if %rss < rss_test { compute rss_test = %rss compute thresh = thresh_test(ii) } end do ii dis 'Threshold = ' thresh * set yy = series1 - thresh dif yy v1+1 v2 dyy set flag = %if(dyy{1}<0,0,1) set y_plus = flag*yy{1} set y_minus = (1-flag)*yy{1} * if lags { linreg dyy v1+lags+1 v2 resids ; # y_plus y_minus dyy{1 to lags} } else { linreg dyy v1+1 v2 resids ; # y_plus y_minus } display display 'M-TAR Unit Root Test, Series' %l(series1) display 'Regression Run From' %datelabel(v1+lags+1) 'to' %datelabel(v2) exclude # y_plus y_minus display '---------------------------------------------------------' display ' With consistent threshold ' display '---------------------------------------------------------' compute f = %cdstat compute nobs = %nobs + 1 display 'critical values at' @20 '90%' @28 '95%' @36 '97.5%' @44 '99%' if nobs<100 display @3 'for 50 obs.' @19 #.## consistent(1,2) @27 #.## consistent(1,3) @36 #.## consistent(1,4) $ @43 #.## consistent(1,5) if nobs>100.and.nobs<250 display @3 'for 100 obs.' @19 #.## consistent(2,2) @27 #.## consistent(2,3) @36 #.## consistent(2,4) $ @43 #.## consistent(2,5) if nobs>250 display @3 'for 250 obs.' @19 #.## consistent(3,2) @27 #.## consistent(3,3) @36 #.## consistent(3,4) $ @43 #.## consistent(3,5) * now test rho1 = rho2 display '-----------------------------------------------------------------------' disply 'Perform the test for symmetric adjustment(rho1=rho2)' restrict 1 # 1 2 # 1 -1 0 } } end