Dear all,
My data includes 300 firms from 2000 to 2017. I estimate fitted values by year as follows:
My question: How can I estimate the fitted value with the mean coefficient from these regressions? I can obtain the mean coefficient with the following code:
However, I don't know the command to calculate the fitted value of y with the mean coefficient?
I would really appreciate all the help I can get.
Best regards
My data includes 300 firms from 2000 to 2017. I estimate fitted values by year as follows:
Code:
egen group = group(year) gen fitted = . summarize group, meanonly forval g = 1/`r(max)' { regress y x1 x2 if group == `g' predict work replace fitted = work if group == `g' drop work }
Code:
statsby, by(year) saving(tempfile, replace): regress y x1 x2
I would really appreciate all the help I can get.
Best regards
Comment