My task requires me to write the twoway commands many times, like
Since the number of city names is large, the conventional command style is inconvenient. I want to make use of macro, like
But the stata keeps telling me that "parentheses do not balance". Can anyone tell me the source of this error. If there is other possible way to
write multiple twoway commands in a more clear and convenient way, it's welcomed. Thank you.
Code:
twoway (line land year if city=="NewYork") (line land year if city=="Boston") ······ (line land year if city=="Tucson") , options
Code:
local city "NewYork" "Boston" ······ "Tucson" global twograph foreach i of local city { global twograph ${twograph} (line land year if city == `i',lwidth(medthick)) } twoway $twograph, legend(off)
write multiple twoway commands in a more clear and convenient way, it's welcomed. Thank you.
Comment