** Chapter 19.9 ** for W.H. Greene, Econometric Analysis 6th ed. **************** * (c) Noel Roy 2003, 2008 * * SERIAL CORRELATION * *=============================================================================== * * 19.7 TESTING FOR AUTOCORRELATION * 19.9 ESTIMATION WHEN OMEGA IS UNKNOWN * * 19.9.2 (p. 649) Application: Estimation of a Model with Autocorrelation * READ (TableF2-2.txt) Year,GasExp,Pop,Gasp,Income,PNC,PUC,PPT,PD,PN,PS /SKIPLINES=1 * GENR lGpop = LOG(GasExp/Pop/Gasp) GENR lPg = LOG(Gasp) GENR ly = LOG(Income) GENR LPnc = LOG(Pnc) GENR LPuc = LOG(Puc) * Calculate time trend GENR t=year-1952 TIME 1953.0 1 SAMPLE 1953.0 2004.0 * * Estimate the OLS regression (Row 1 of Table 19.2). * The option DWPVALUE calculates the exact p-value of the Durbin-Watson * statistic, so that using upper and lower significance values (with a * possIble indeterminate test result) is unnecessary. * OLS LGPOP LY LPG LPNC LPUC t /RSTAT GRAPH RESID=E DWPVALUE LOGLOG * * (The results reported in Table 19.2 for the OLS estimator are incorrect; * they are based on the sample 1954-2004 rather than 1953-2004. The true * values appear in Table 6.7 of the teXtbook, which replicates the results * here). * * The DIAGNOS command with the /ACF option calculates a number of test * statistics on the residuals of the immediately preceding estimation * command, including simple autocorrelations (RHO), Durbin-Watson test * statistics at various lags, and the Box-Pierce statistic Q in equation * (19-21), which however does not agree with the value reported in the * textbook. See pp. 182-83 of the SHAZAM Manual for further information. * DIAGNOS /ACF * * Calculate the Lagrange Multiplier test (19-20). There are missing values for * the lagged values of the residual, which some versions of the test * fill with zeroes (see footnote 11 on p. 645), including the one reported in the * textbook. We can do this by changing the missing value indicator from the * default value of -99999 to 0, using the SET MISSVALU command. * SET MISSVALU=0 SET NODOECHO DO #=1 5 GENR ELAG#=LAG(E,#) ENDO OLS E LPG LY LPNC LPUC T ELAG1-ELAG5 GEN1 LM=$N*$R2 DISTRIB LM /TYPE=CHI DF=5 * * The AUTO command provides features for estimation of models with auto- * correlated errors. Unfortunately, we have not been able to replicate any * of the results in Table 19.2, excpet for the maximum likelihood estimates. * Apparently, SHAZAM uses an estimate of rho * that is different from that used in the textbook. Of course, any * consistent estimator of rho gives FGLS estimates. * * The AUTO command, by default, uses the Cochrane-Orcutt/Prais-Winsten * iterative procedure for estimating rho. The ITER= option is used to specify * the number of iterations to be performed when using the C-O procedure. * SHAZAM, by default, continues further iterations until successive estimates * of rho differ by less than 0.001. While there is no asymptotic benefit * to these iterations, it can be argued that the iterated estimates of rho * are "better" in small samples. * The AUTO command is discussed further in Chapter 13 of the SHAZAM Manual. AUTO LGPOP LY LPG LPNC LPUC T / LOGLOG RSTAT * * The Prais-Winsten two-step estimation discussed in the text is performed by * using only one iteration past the initial OLS iteration. Hence, set ITER= to 1. * AUTO LGPOP LY LPG LPNC LPUC T / LOGLOG ITER=1 RSTAT * * The Cochrane-Orcutt estimates are estimated as above but the first * observation is dropped. This is done using the DROP option. * AUTO LGPOP LY LPG LPNC LPUC T/RSTAT DROP LOGLOG ITER=1 * * Maximum Likelihood estimates are obtained by the /ML option. * AUTO LGPOP LY LPG LPNC LPUC T /RSTAT ML LOGLOG * * The ORDER= option with the AUTO command can be used to estimate models with * second-order or higher-order autocorrelation. * AUTO LGPOP LY LPG LPNC LPUC T/RSTAT LOGLOG ORDER=2 ITER=1 * STOP * *=============================================================================== * * Updated November 7, 2008