Hello STATers,
How do I retain my predicted values from a regression
when using the "by group" command?
for example:
by company: reg x y1 y2 y3
predict zresid, rstudent
Is it possible to create a data file that contains the
zresids that is associated with the regression for
each each company?
I think the best way is probably in a loop, using the official Stata
-levels- command and my own -dsconcat- package (downloadable from SSC),
similarly to the following (assuming that -company- is an integer-valued
variable):