Bookmark and Share

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]

Re: st: saving residuals for many regressions


From   Rodrigo Briceño <[email protected]>
To   [email protected]
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 <[email protected]>:
> --- 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
[email protected]
MSN: [email protected]
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/


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