* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapter 4.1.1 Prediction in the Food Expenditure Model (p. 134) * Use the DIM command to allocate space for the variables DIM FOOD 41 INCOME 41 YHAT 41 SE 41 * Set a value for income for the prediction exercise. * Be careful with units of measurement. * In the data set, weekly income is reported in \$100. * Therefore, the number 20 represents \$2000 weekly income. SAMPLE 41 41 GENR INCOME=20 * Load the data set SAMPLE 1 40 READ (food.dat) / names * Least squares estimation OLS FOOD INCOME * Prediction FC / LIST BEG=41 END=41 PREDICT=YHAT FCSE=SE * Note: the calculated residual and prediction diagnostics from * FC are not meaningful since there is no observed value for FOOD. * Calculate a 95% prediction interval * Obtain the critical value. GEN1 DF=\$N-\$K SAMPLE 1 1 GEN1 ALPHA=0.05/2 DISTRIB ALPHA / TYPE=T DF=DF INVERSE CRITICAL=TC PRINT TC SAMPLE 41 41 GENR YUP=YHAT+TC*SE GENR YLOW=YHAT-TC*SE * Print the predicted value and the standard error PRINT YHAT SE * Print the prediction interval PRINT YLOW YUP STOP