Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Combining residuals of multiple regressions

From   roderick <>
To   "" <>
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>>; 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!

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index