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]

st: loop for graphs


From   <redacted>
To   [email protected]
Subject   st: loop for graphs
Date   Fri, 8 Jul 2011 11:43:06 +0800

hi to everyone,

i guess this is simple, but i still have not found the right ways to
do it. 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. i would like to have 3 separate scatterplots (a1 vs x), (b1 vs
x) and (c1 vs x), with these graphs have different filename or at
least combined in a single graph.

Please, this is simple but i really need help.

Thank you

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