> -foreach- allows you to loop over a varlist. varlists allow many
> shortcuts for specifying a large number of variables. see -help
> foreach- and -help varlist-.
>
> If you wanted to store the variable names, you typically would not do
> that in a vector but in a local. However, unless you are writing a
> general use program, you would typically not need to do that.
I don't think varlist will help me. I need the name of the variable, because
I want to do something with it. That's why I hoped to be able to make string
arrays. Say that I would want to do (in some pseudo code):
v=("a","b","c")
foreach name in v {
gen `name'2=2*`name'
gen `name'3=3*`name'
}
How would I do something like that?
Thanks already, best regards,
-Hendri.
*
* 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/