Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: store error term from individual panel regressions

From   Steven Archambault <>
Subject   st: store error term from individual panel regressions
Date   Sat, 27 Aug 2011 13:27:34 -0600

Hi all,

I have panel data with 100 panels over 20 time periods. I want to run
a regression on each panel, and then store the error term as a new
variable. But, I want to do this with each panel individually, and
then use the results in a new model. I can do them one at a time as

reg y time if code==1
predict e_code1 if code==1, stdp

reg y time if code==2
predict e_code2 if code==2, stdp

This gets pretty cumbersome to do one by one. Can somebody suggest a
more efficient way?

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index