Predict Manually - Linear Model (huge dataset)

#1
Dears,

I need to predict a model manually. I regress an equation like reg y i.educ i.exper if year == 1980 and after this reg y i.educ i.exper if year == 2000 . What i want to do is predic y using the covariates of year 2000 and the coefficients of year 1980, that is, i want to calculate yhat = x2000 * beta1980. My data sets are huge, about 400000 observations. I tried to calculate with matrices, but stata shows a message that the size is not sufficient and the maximun matrix size in not enough.

Does anyone know how can i do it?


Thank you very much
 

bukharin

RoboStataRaptor
#2
Not sure I understand exactly what you're doing, but you can access the coefficients from a regression easily enough - see -help return- and try -ereturn list-. The coefficients are returned in a matrix called b.

As a shortcut you can access the intercept as _b[_cons] and the coefficients using eg _b[2.educ]