Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Combining residuals of multiple regressions
From
roderick <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Combining residuals of multiple regressions
Date
Wed, 19 Feb 2014 12:03:27 +0100
Dear Stata community,
For my thesis, I am running US-state-specific regressions and saving the state-specific residuals. The commands for the first two regressions look as follows (the variables shown are just for illustration purposes):
regress accidentsvso unemp if(state==1)
predict res1 if(state==1), r
regress accidentsvso unemp if(state==4)
predict res4 if(state==4), r
Now, I would like to create a variable that captures the residuals of all these regressions. So, I want to 'merge' all state-specific residuals and put them in into one list (as can be seen here>> http://i60.tinypic.com/9ptceo.png; I want the seventh column to contain all residuals).
This is probably a simple question, but I could not figure out how to do it. I am using Stata 12 for Windows.
Thanks in advance!
Roderick
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/