* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapters 4.5.2 to 4.5.5 (pages 153-5) * A Wage Equation and 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 (cps4_small.dat) / names * Use the GENR command to create Log transformed observations GENR lwage=log(wage) * Predict wage for a worker with 12 years of education. GEN1 educ:1001=12 * Equation estimation with a log-dependent variable * The RSTAT option reports the goodness-of-fit measure: * R-SQUARE BETWEEN ANTILOGS OBSERVED AND PREDICTED OLS lwage educ / LOGLIN RSTAT * Confidence interval estimation CONFID educ * 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 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 PRINT ylow yup * The prediction interval is not symmetric about the point prediction. STOP