** Chapter 19.11 ** for W.H. Greene, Econometric Analysis 6th ed. **************** * (c) Noel Roy 2003, 2008 * * SERIAL CORRELATION * *=============================================================================== * * 19.11 COMMON FACTORS * * Example 19.6 Tests for Common Factors (p. 656) * TIME 1953.0 1 SAMPLE 1953.0 2004.0 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) GENR t=year-1952 * * Set up the lag values. GENR LGPOPLAG = LAG(LGPOP) GENR LPGLAG = LAG(LPG) GENR LYLAG = LAG(LY) GENR LPNCLAG = LAG(LPNC) GENR LPUCLAG = LAG(LPUC) * * Estimate the unrestricted model, dropping the first observation. SAMPLE 1954.0 2004.0 OLS LGPOP LGPOPLAG LY LYLAG LPG LPGLAG LPNC LPNCLAG LPUC LPUCLAG T * Store the SSE and parameters GEN1 SSEU=$SSE GEN1 N=$N GEN1 K=$K * * Extract the start values from the non-linear regression frim the base model. ?OLS LGPOP LY LPG LPNC LPUC T /COEF=BETAU * Add in the start value for rho (zero). MATRIX ZERO=0 MATRIX BETAU1=(ZERO|BETAU')' * Estimate the restricted model by non-linear least squares. NL 1 /NCOEF=7 START=BETAU1 ITER=200 EQ LGPOP = RHO*LGPOPLAG + BETA2*(LY-RHO*LYLAG) + BETA3*(LPG-RHO*LPGLAG) + BETA4*(LPNC-RHO*LPNCLAG) + BETA5*(LPUC-RHO*LPUCLAG) + BETA6*(T-RHO*(T-1)) + BETA1 END * Save SSE GEN1 SSER=$SSE * Calculate F statistic GEN1 F = ((SSER-SSEU)/(K-7))/(SSEU/(N-K)) GEN1 DF1=K-7 GEN1 DF2=N-K DISTRIB F /TYPE=F DF1=DF1 DF2=DF2 * STOP * *=============================================================================== * * Updated November 10, 2008