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: Regressing and storing residuals in one line.

From   Dani Tilley <>
Subject   st: Regressing and storing residuals in one line.
Date   Sun, 27 Jun 2010 20:04:10 -0700 (PDT)


I'm trying to run several regressions (one for each level of a categorical variable) and store the residuals from each regression in a local macro or new 
variable I could later manipulate. I figured I could use:

bysort category: regress y x1 x2 

to run the regressions, but I need a second line of code (predict name, residuals) to get the residuals when bysort allows only one. Is there a way around this? 


Dani F. Tilley

*   For searches and help try:

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