* Chapter 7 - The Classical Multiple Linear Regression Model * W.H. Greene, Econometric Analysis, Fourth Edition, 2000. SAMPLE 1 36 READ (gasoline.shd) / NAMES * Example 7.8, p. 289 GENR LG=LOG(100*G/POP) GENR LINC=LOG(Y) GENR LPGAS=LOG(PG) GENR LPNEW=LOG(PNC) GENR LPOLD=LOG(PUC) * Regression for 1960-1995 OLS LG LINC LPGAS LPNEW LPOLD YEAR / LOGLOG * Test for structural change with the DIAGNOS command. * The number of observations in the first group is specified with * the CHOWONE= option. DIAGNOS / CHOWONE=14 * Separate regression for 1960-1973 SAMPLE 1 14 OLS LG LINC LPGAS LPNEW LPOLD YEAR / LOGLOG GEN1 SSE1=$SSE * Separate regression for 1974-1995 SAMPLE 15 36 OLS LG LINC LPGAS LPNEW LPOLD YEAR / LOGLOG GEN1 SSE2=$SSE GEN1 SSEU=SSE1+SSE2 GEN1 K=$K * Example 7.9, p. 290 SAMPLE 1 36 * Set regime dummy variables. * Note that the IF expression is set to avoid rounding error * when defining the dummy variables. IF (YEAR.LE.1973.01) PRESHOCK=1 IF (YEAR.GT.1973.01) POSTSHCK=1 * Pooled regression with different constant terms. * Estimation results in the first column of Table 7.4, p. 290. * Avoid the dummy variable trap -- use the NOCONSTANT option. OLS LG PRESHOCK POSTSHCK LINC LPGAS LPNEW LPOLD YEAR / LOGLOG NOCONSTANT * Example 7.10, p. 291 * Generate interaction variables to allow different slope coefficients * for log(I) and log(PG). GENR DLINC=PRESHOCK*LINC GENR DLPGAS=PRESHOCK*LPGAS OLS LG PRESHOCK POSTSHCK LINC DLINC LPGAS DLPGAS LPNEW LPOLD YEAR / & LOGLOG NOCONSTANT GEN1 SSER=$SSE GEN1 DF=$N-2*K * Calculate the F-test statistic GEN1 F=((SSER-SSEU)/3)/(SSEU/DF) SAMPLE 1 1 * Compute a p-value DISTRIB F / TYPE=F DF1=3 DF2=DF CDF=CDF GEN1 PVALUE=1-CDF PRINT F PVALUE * Note that the value of 0.981 reported in the text is the CDF. * Example 7.13, p. 297 SAMPLE 1 36 OLS LG LINC LPGAS LPNEW LPOLD YEAR / LOGLOG * Use the DIAGNOS command for tests of model stability * The HANSEN option reports Hansen's test of model stability. * The RECUR option reports CUSUM and CUSUMSQ tests based on * recursive residuals. * The GRAPH option prepares the plots shown in Figure 7.3, pp. 296-297. DIAGNOS / HANSEN RECUR GRAPH * Note that the Greene textbook web site reports errata for the * Hansen test statistic at the top of p. 294 as well as the results * reported in Example 7.13. * The Hansen test statistic is H=1.7249. STOP