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: loop for graphs


From   <redacted>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: loop for graphs
Date   Fri, 8 Jul 2011 18:44:30 +0800

Dear Kit,

yup, it works ..
wonderful .. Thank you very2 much

Best regards

<redacted>

On Fri, Jul 8, 2011 at 12:25 PM, Christopher Baum <kit.baum@bc.edu> wrote:
> <>
> I have 3 dependent variables (a1,b1,c1) that i want plot
> against 1 var (x). i will be using scatter plot and  hope to use these
> commands
>
> foreach var of varlist a1-c1 {
> graph twoway (scatter `var' x ) (lfit `var' x), saving(gr.gph)
> }
>
> with those line, i will only get the last graph but no the other 2
> graphs.
>
>
> Try
>
> foreach var of varlist a1-c1 {
>        graph twoway (scatter `var' x ) (lfit `var' x), saving(`var'.gph, replace)
> }
>
> Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
>                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
>   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html
>
>
>
>
> *
> *   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/
>



-- 
<redacted>
<redacted>
<redacted>
<redacted>

<redacted>

*
*   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