* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapters 5, 6 - The Multiple Regression Model * To get started, use the DIM command to allocate some extra space * for a prediction exercise that comes later. DIM SALES 76 PRICE 76 ADVERT 76 ADV2 76 YHAT 76 SE 76 * Observations on Sales Revenue, Price and Advertising * for a sample of 75 cities SAMPLE 1 75 READ (andy.dat) / names * Summary statistics (Table 5.1, p. 171) STAT SALES PRICE ADVERT * Least squares estimation (Table 5.2, p. 175). * On the OLS output the estimate of the error variance is reported as: * VARIANCE OF THE ESTIMATE-SIGMA**2 (p. 177). * On the OLS command the PCOV option reports the estimated variance- * covariance matrix of the parameter estimators (Table 5.3, p. 179). OLS SALES PRICE ADVERT / PCOV * Interval estimation (pp. 182-3). CONFID PRICE ADVERT * The TEST command uses the results from the previous OLS * estimation command. On the TEST command the variable names * represent the regression coefficients. * Testing advertising effectiveness (p. 188). * Note: The TEST command reports a test statistic and * p-value for a 2-sided test. This p-value can be transformed * to a p-value for a one-sided test. TEST ADVERT=1 * Testing a linear combination of coefficients (p. 189) TEST -0.2*PRICE - 0.5*ADVERT * An interval estimate for a linear combination of coefficients (pp. 183-4) TEST -0.4*PRICE + 0.8*ADVERT * The TEST command saves the test value and standard error in * the temporary variables $VAL and $STES. * Now construct a 90% interval estimate GEN1 LOW = $VAL - 1.666*$STES GEN1 UP = $VAL + 1.666*$STES PRINT LOW UP * Chapter 5.6.2 An extended model (Equation 5.24, p. 193) GENR ADV2=ADVERT**2 * On the OLS command the ANOVA option reports the analysis of variance * table and the F-test for overall significance (top of p. 227). OLS SALES PRICE ADVERT ADV2 / ANOVA * A joint test for the significance of advertising (p. 225). TEST TEST ADVERT=0 TEST ADV2=0 END * A test for the optimal level of advertising (p. 229). TEST ADVERT+3.8*ADV2=1 * A joint test (p. 231). TEST TEST ADVERT+3.8*ADV2=1 TEST CONSTANT+6*PRICE+1.9*ADVERT+3.61*ADV2=80 END * A test for a nonlinear combination of coefficients (pp. 193-5). * The TEST command calculates a standard error for nonlinear functions. TEST (1-ADVERT)/(2*ADV2) * The TEST command saves the test value and standard error in * the temporary variables $VAL and $STES. * Now construct an approximate 95% interval estimate GEN1 LOW = $VAL - 1.994*$STES GEN1 UP = $VAL + 1.994*$STES PRINT LOW UP * Chapter 6.5.1 Prediction * Prediction exercise, pages 244-5. * Use observation 76 for the prediction. GEN1 PRICE:76=6 GEN1 ADVERT:76=1.9 GEN1 ADV2:76=1.9**2 SAMPLE 1 75 OLS SALES PRICE ADVERT ADV2 FC / LIST BEG=76 END=76 PREDICT=YHAT FCSE=SE * Note: The forecast diagnostics listed by the FC command have * no meaningful interpretation in this example that computes * out-of-sample predictions. * The forecast diagnostics are only valid for within sample predictions. * Calculate a 95% interval estimate for the prediction, * middle of page 245. GEN1 LOW = YHAT:76 - 1.994*SE:76 GEN1 UP = YHAT:76 + 1.994*SE:76 SAMPLE 76 76 PRINT YHAT SE LOW UP STOP