** Chapter 20.4 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * MODELS WITH LAGGED VARIABLES * *=============================================================================== * * 20.4 AUTOREGRSSSIVE DISTRIBUTED LAG MODELS * * Example 20.4 (p. 685) A Rational Lag Model * * Use the TIME command to read in quarterly data. * TIME 1950 4 SAMPLE 1950.1 2000.4 READ (TableF5-1.prn) Year Qtr Y C / SKIPLINES=1 * * Transform Data into logarithms. * GENR C=LOG(C) GENR Y=LOG(Y) * * Estimate ARDL(3,3) model. * * Set up seasonal dummies. DO #=1,3 IF (Qtr.eq.#) Q#=1 ENDO * GENR LC1=LAG(C) GENR LC2=LAG(C,2) GENR LC3=LAG(C,3) GENR LY1=LAG(Y) GENR LY2=LAG(Y,2) GENR LY3=LAG(Y,3) SAMPLE 1950.4 2000.4 OLS C LC1-LC3 Y LY1-LY3 Q1-Q3 /COEF=BETA DLAG LOGLOG * * Contrary to what is stated in the Example, the Durbin-Watson test is * not valid in the presence of a lagged dependent variable (see Section * 19.7.4 of the text). In these circumstances, the DLAG option will report * the Durbin h-statistic. The lagged dependent variable must be the first * independent variable when this option is used. * * Calculate long-run effect. * TEST (Y+LY1+LY2+LY3)/(1-LC1-LC2-LC3) * * Calculate the values of the ARDL polynomial recursively. * DIM ALPHA 8 GEN1 ALPHA(1)=BETA(4) GEN1 ALPHA(2)=BETA(5)+ALPHA(1)*BETA(1) GEN1 ALPHA(3)=BETA(6)+ALPHA(1)*BETA(2)+ALPHA(2)*BETA(1) GEN1 ALPHA(4)=BETA(7)+ALPHA(1)*BETA(3)+ALPHA(2)*BETA(2)+ALPHA(3)*BETA(1) DO #=5,8 GEN1 ALPHA(#)=BETA(1)*ALPHA(#-1)+BETA(2)*ALPHA(#-2)+BETA(3)*ALPHA(#-3) ENDO * * Define the C matrix. * DIM CM 3 3 MATRIX CM=0 COPY BETA CM /FROW=1,3 TROW=1,3 TCOL=1,1 MATRIX CM(1,2)=1 MATRIX CM(2,3)=1 * * Calculate and print eigenvalues. * MATRIX E=EIGVAL(CM) PRINT E * * Estimate the unrestricted lag model. * If the distributed lag format is used, the sums of the coefficients * (which measure the long-run effect) are automatically reported. * SAMPLE 1950.1 2000.4 OLS C Y(0.7) Q1-Q3 /COEF=Unrestr PREDICT=CHAT LOGLOG * * Tabulate lag coefficients for the two models as in Table 20.3. * RENAME ALPHA ARDL SAMPLE 1 8 GENR LAG=TIME(-1) FORMAT (1X, F9.0, 2F17.3) PRINT LAG ARDL Unrestr /FORMAT * * Some some reason, the unrestricted results do not match those * in Table 20.3. * * Test ARDL model against the unrestricted model using the J test. * SAMPLE 1951.1 2000.4 ?OLS C C(1.3) Y(0.3) Q1-Q3 CHAT TEST CHAT * * With a t-value of -1.216, we cannot reject the ARDL model against the * alternative unrestricted model. * STOP * *=============================================================================== * Updated November 12, 2008