I would like to predict the mean and standard error conditional on some dummies in a data set containing four variables: y, year, control1 and control2. That is, I would like to estimate E[y | year] for the following linear model y = \alpha + \beta * year + \gamma * control1 + \delta * control2 + \varepsilon. I run the following Stata code:
Is this correct? Or am I really doing something entirely/subtly different?
Code:
xi: reg y i.year control1 control2 collapse y control1 control2, by(year) predict cond_mean, xb predict cond_mean, stdp
Comment