Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Graphs and Log files


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Graphs and Log files
Date   Thu, 12 Dec 2002 00:09:27 -0000

Ricardo Mora-Castrillo

> Now I am trying to run this in a more efficient way?? Does 
> any of you have an idea?
> 
> foreach varx0 of varlist pill0 iud0 vag0 condom0 rhythm0 
> withd0 stfem0 
> stmasc0 inject0 {
> foreach varx1 of varlist pill1 iud1 vag1 condom1 rhythm1 
> withd1 stfem1 
> stmasc1 inject1 {
>    graph `varx0'`varx1' year, symbol(i i) connect(l l[.]) 
> xscale(1975,2000) 
> yscale(0,1) saving(`varx0', replace)
> }
> }

The two nested loops will produce 9 * 9 
graphs. I suspect you want just 9 graphs, as in 

foreach v in pill iud vag condom rhythm withd stfem stmasc inject {
	graph `v'0 `v'1 year, symbol(ii) connect(ll[.]) /* 
      */ xscale(1975,2000) yscale(0,1) saving(`v', replace)
}


Nick 
n.j.cox@durham.ac.uk 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index