* Reference: Chapter 6 of * Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, * South-Western College Publishing, 2000. * The DIM command is used to allocate space for the * variables used in the prediction exercise. DIM lsalary 178 lsales 178 lmktval 178 ceoten 178 DIM lyhat 178 * Load the data SAMPLE 1 177 READ (CEOSAL2.shd) salary age college grad comten ceoten sales profits & mktval lsalary lsales lmktval comtensq ceotensq profmarg * Examples 6.7 and 6.8 * Set the values for use in prediction. SAMPLE 178 178 GENR lsales=log(5000) GENR lmktval=log(10000) GENR ceoten=10 * Equation (6.43), p. 204 SAMPLE 1 177 OLS lsalary lsales lmktval ceoten / LOGLOG RSTAT PREDICT=lyhat * The LOGLOG option on the OLS command specifies that the dependent * variable is log transformed. * With the LOGLOG and RSTAT options, the SHAZAM output reports the * statistic R-SQUARE BETWEEN ANTILOGS OBSERVED AND PREDICTED * This R-square can be compared with the R-square reported * for the equation with the dependent variable in levels. * The FC command uses the results from the previous regression for * prediction. The PREDICT= option saves the predicted values in the * variable specified. The variable lyhat has been previously set * with a DIM command. FC / LIST BEG=178 END=178 PREDICT=lyhat * Get an estimate of alpha_0 using the method given on p. 203 GENR mhat=EXP(lyhat) OLS salary mhat / NOCONSTANT COEF=alpha0 * Estimate the anti-log point prediction SAMPLE 178 178 GENR YHAT=alpha0*EXP(lyhat) PRINT YHAT STOP