=SET NOECHO PROC SEASROOT * ===================================================================== * SHAZAM procedure for seasonal unit root testing for quarterly time series. * * References: * S. Hylleberg, R.F. Engle, C.W.J. Granger and B.S. Yoo, 1990, * "Seasonal Integration and Cointegration", Journal of Econometrics, * Vol. 44, pp. 215-238. * H.S. Lee and P.L. Siklos, 1991, "Unit Roots and Seasonal Unit Roots in * Macroeconomic Time Series", Economics Letters, Vol. 35, pp. 273-277. * G. Otto and T. Wirjanto, 1990, "Seasonal Unit Root Tests on Canadian * Macroeconomic Time Series", Economics Letters, Vol. 34, pp. 117-120. * * Description: * With a quarterly time series X(t) consider the autoregression: * YD4(t)=P1*Y1(t)+P2*Y2(t)+P3*Y3(t)+P4*Y4(t) + e(t) * where: * YD4(t)=X(t)-X(t-4) * Y1(t)=X(t-1)+X(t-2)+X(t-3)+X(t-4) * Y2(t)=-[X(t-1)-X(t-2)+X(t-3)-X(t-4)] * Y3(t)=-[X(t-2)-X(t-4)] and * Y4(t)=X(t-1)-X(t-3) * * Two augmented forms of the regression include: * (A) intercept, no seasonal dummies, no trend * (B) intercept, seasonal dummies, no trend * * Test statistics to consider are: * 1. t-test statistic for P1=0 * 2. t-test statistic for P2=0 * 3. F-test statistic for P3=0 and P4=0. * * Critical values are tabulated in Hylleberg et al. (pp. 226-7). * 5 % critical values (generated using 200 observations) are: * (A) (B) * 1. -2.87 -2.91 * 2. -1.92 -2.89 * 3. 3.12 6.61 * * If all tests are rejected then a series has no unit roots and * is stationary. * If test 2. and 3. are rejected then there are no seasonal unit roots. * * ===> Procedure Notes: * (1) Quarterly data is assumed. * (2) The data is transformed to logarithms. To suppress this change the * command MATRIX X_=LOG(X_) to MATRIX X_=X_. * (3) The regression can include additional lags of the regressand to * to whiten the errors. The commands below include D4X_(1.6) * in the list of regressors. However, this is arbitrary and * the user may need to investigate the time series properties * further to decide on an appropriate lag choice. * * Use: * FILE PROC SEASROOT * SAMPLE beg end * VARS: list of variables to individually test for unit roots. * EXEC SEASROOT * * Programmed by Diana Whistler, Revision Date: January 2002 * E-mail: diana@shazam.econ.ubc.ca * ===================================================================== SET NODOECHO NOOUTPUT FORMAT(/' Seasonal unit root tests for variables:') PRINT / FORMAT PRINT VARS / NONAMES FORMAT(/10X,'PI_ are tests with no seasonal dummies and'/ & 10X,'PIQ_ are tests with seasonal dummies') PRINT / FORMAT FORMAT(/' Test statistics'/ & 5X,'1. test for a unit root at zero frequency'/ & 5X,'2. test for a bi-annual cycle root'/ & 5x,'3. test for an annual cycle root') PRINT / FORMAT COPY [VARS] X_ / TROW=1,$N * Take logs of the data MATRIX X_=LOG(X_) GEN1 N_=$COLS GEN1 T_=$ROWS DIM PI_ 3 PIQ_ 3 DO #=1,N_ * Generate regressors SAMPLE 5 T_ SET NOWARN GENR D4X_=X_:#-LAG(X_:#,4) GENR S1_= LAG(X_:#)+LAG(X_:#,2)+LAG(X_:#,3)+LAG(X_:#,4) GENR S2_=-(LAG(X_:#)-LAG(X_:#,2)+LAG(X_:#,3)-LAG(X_:#,4)) GENR S3_=-(LAG(X_:#,2)-LAG(X_:#,4)) GENR S4_= LAG(X_:#)-LAG(X_:#,3) SET WARN * Run a regression and get test statistics OLS D4X_ S1_ S2_ S3_ S4_ D4X_(1.6) / TRATIO=TSTAT_ TEST TEST S3_=0 TEST S4_=0 END GEN1 PI_:3=$F GEN1 PI_:1=TSTAT_:1 GEN1 PI_:2=TSTAT_:2 * Generate seasonal dummy variables MATRIX QD_=SEAS(T_,4) * Now include quarterly seasonal dummy variables in the regression. OLS D4X_ S1_ S2_ S3_ S4_ D4X_(1.6) QD_ / NOCONSTANT TRATIO=TSTATQ_ TEST TEST S3_=0 TEST S4_=0 END GEN1 PIQ_:3=$F GEN1 PIQ_:1=TSTATQ_:1 GEN1 PIQ_:2=TSTATQ_:2 * Print the results FORMAT(/' Variable',F6.0) PRINT $DO / FORMAT NONAMES SAMPLE 1 3 GENR TEST_=TIME(0) FORMAT(5X,F5.0,2(5X,F10.4)) PRINT TEST_ PI_ PIQ_ / FORMAT ENDO DELETE / ALL_ SET DOECHO OUTPUT PROCEND SET ECHO