* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Third Edition, Wiley, 2008. * Chapter 4.4.2 A Wage Equation * Chapters 4.4.3, 4.4.4, 4.4.5 Prediction with a log-dependent variable * Use the DIM command to allocate space for the prediction exercise. DIM lwage 1001 educ 1001 yhat 1001 se 1001 SAMPLE 1 1000 READ (cps_small.shd) wage educ exper female black white midwest south west * Use the GENR command to create Log transformed observations GENR lwage=log(wage) * Equation estimation with a log-dependent variable (p. 95) * The RSTAT option reports the goodness-of-fit measure: * R-SQUARE BETWEEN ANTILOGS OBSERVED AND PREDICTED * (Chapter 4.4.4, p. 96) OLS lwage educ / LOGLIN RSTAT * Confidence interval estimation (p. 95) CONFID educ * Predict wage for a worker with 12 years of education. GEN1 educ:1001=12 OLS lwage educ / LOGLIN RSTAT * Log prediction FC / LIST BEG=1001 END=1001 PREDICT=yhat FCSE=se * Note: the calculated residual and prediction diagnostics from * FC are not meaningful since there is no observed value for wage. * Save the degrees of freedom in the variable DF. GEN1 DF=$N-$K * Estimate the anti-log point prediction (bottom of p. 95) GEN1 yhat1=yhat:1001 GEN1 se1=se:1001 GEN1 yhatA=EXP(yhat1+se1*se1/2) PRINT yhatA * Calculate a 95% prediction interval. * Obtain the critical value. SAMPLE 1 1 GEN1 ALPHA=0.05/2 DISTRIB ALPHA / TYPE=T DF=DF INVERSE CRITICAL=TC * Estimate a confidence interval for the log prediction GEN1 yup=yhat1+TC*se1 GEN1 ylow=yhat1-TC*se1 * Estimate a confidence interval for the anti-log prediction GEN1 yup=EXP(yup) GEN1 ylow=EXP(ylow) * Print the results (bottom of p. 96) PRINT ylow yup * The prediction interval is not symmetric about the point prediction. STOP