Dear Statalist:
I have a loop creating twoway graphs along the lines of the following:
levels idvar, local(ID)
foreach i of local ID{
#delimit;
di "`i'";
twoway (line yvar xvar if idvar=="`i'" & idvar2==1 & idvar3==1, lpattern(dash))
(line yvar xvar if idvar=="`i'" & idvar2==2 & idvar3==1, lpattern(dash))
(line yvar2 xvar2 if idvar=="`i'" & idvar2==1 & idvar3==1, color(navy)
yaxis(2) lpattern(dash))
title("`i')
};
And I would like the legend to be: legend(label(1 =idvar2_name if
idvar=="`i'" & idvar2==1 & idvar3==1) label(2 =idvar2_name if
idvar=="`i'" & idvar2==2 & idvar3==1))
How might I accomplish this? I found this
(http://www.stata.com/statalist/archive/2004-03/msg00129.html) in the
archive but couldn't quite get from there to where I would like to be.
Thank you!
*
* 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/