Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Rodrigo Briceño <rjbriceno@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: saving residuals for many regressions |
Date | Thu, 25 Nov 2010 14:01:33 -0600 |
Thanks Maarten, your solution is really nice for the issue on saving graphs. Now I only need to have the possibility to save the list of residuals for the 97 regressions. 2010/11/25 Maarten buis <maartenbuis@yahoo.co.uk>: > --- On Thu, 25/11/10, Rodrigo Briceño wrote: >> Now, I have a different challenge: I need to create a table >> with the residuals of all the 97 regressions to be read in excel. > <snip> >> >> The second question is if there is possible to save the 97 >> graphs (of the residuals) to be created. > > *--------------- begin example ----------------- > sysuse auto, clear > recode rep78 1 = 2 > levelsof rep78 > local levs `"`r(levels)'"' > > gen resid = . > foreach lev of local levs { > reg price mpg foreign if rep78 == `lev' > predict resid_t if e(sample), resid > replace resid = resid_t if e(sample) > twoway scatter resid_t mpg, name(gr_`lev') > drop resid_t > } > *----------------- end example ------------------- > (For more on examples I sent to the Statalist see: > http://www.maartenbuis.nl/example_faq ) > > Hope this helps, > Maarten > > -------------------------- > Maarten L. Buis > Institut fuer Soziologie > Universitaet Tuebingen > Wilhelmstrasse 36 > 72074 Tuebingen > Germany > > http://www.maartenbuis.nl > -------------------------- > > > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > -- Rodrigo Briceño Economist rjbriceno@gmail.com MSN: jbric98@hotmail.com SKYPE: rbriceno1087 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/