* 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 colgpa 4138 sat 4138 hsperc 4138 hsize 4138 hsizesq 4138 DIM yhat 4138 fcse 4138 * Load the data set. SAMPLE 1 4137 READ (GPA2.shd) sat tothrs colgpa athlete verbmath hsize hsrank & hsperc female white black hsizesq * Example 6.5 * Set the values for the use in prediction. SAMPLE 4138 4138 GENR sat=1200 GENR hsperc=30 GENR hsize=5 GENR hsizesq=hsize**2 * Equation (6.32), p. 199. SAMPLE 1 4137 OLS colgpa sat hsperc hsize hsizesq * 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 yhat has been previously * set with a DIM command. * * The FCSE= option saves the forecast (prediction) standard errors * in the variable specified. The variable fcse has been previously * set with a DIM command. These results can then be used * for constructing confidence intervals for the prediction. * * The MEANPRED option specifies that the prediction standard * errors are for prediction of the conditional mean of y * for given values of the explanatory variables. FC / MEANPRED LIST BEG=4138 END=4138 PREDICT=yhat FCSE=fcse * Note that the calculated residual and prediction diagnostics * are not meaningful for an out of sample prediction. * Confidence Interval for the Prediction SAMPLE 4138 4138 GENR LOW=yhat-1.96*fcse GENR UP=yhat+1.96*fcse PRINT LOW YHAT UP * Example 6.6 SAMPLE 1 4137 OLS colgpa sat hsperc hsize hsizesq * Prediction - with the FC command the default method for * calculating prediction standard errors is for the problem * of predicting an individual outcome for y for specified values * of the explanatory variables. FC / LIST BEG=4138 END=4138 PREDICT=yhat FCSE=fcse * Confidence Interval for the Prediction SAMPLE 4138 4138 GENR LOW=yhat-1.96*fcse GENR UP=yhat+1.96*fcse PRINT LOW YHAT UP STOP