My problem is how to make a post regression prediction by not using all the coefficients obtained in the regression. I would like to predict the outcome using only the year and age dummies. I solved the problem in a cumbersome way. I am wondering whether there is a more suitable command for that, as it would facilitate my calculations.
I replace all the values of the coefficients dum1-dum26 with 0's. The command 'predict' delivers me the prediction using only the age and year dummies.
Code:
qui reg wage dum1-dum26 i.year i.age, r
Code:
forv i = 1(1)26 { replace dum`i'=0 if dum`i'==1 } predict yhat, xb
Comment