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
[email protected]
*
* 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/