I use the procedure xtreg, fe to make a fixed effects estimation. I have
got a panel data set that consists of 500 individuals. I have information
about two years (year1 and year2) for each person. In the long form this
data consists of 1000 observations. That is, the number of observations
in the fixed effects estimation is 1000. Afterwards, I want to predict
u(i) to get a single value for each person. Right now I get a value for
each observation. That is, u(i)-year1 and u(i)-year2. How do I get a
single value for each person?
Why not predict if year==1 (or if year==2)? I'm not sure what you're trying
to do; there are as many in-sample predicted values as there are
observations, as there would be in any regression. Do you mean you want the
average prediction by individual? Then just generate the standard
prediction and collapse on the year variable; that will generate a new data
set with 500 obs., each the average of y-hat for an individual.