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]

re: st: loop for graphs

From   Christopher Baum <>
To   "" <>
Subject   re: st: loop for graphs
Date   Fri, 8 Jul 2011 00:25:10 -0400

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

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


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   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

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