Am Donnerstag, 1. Juli 2004 03:16 schrieb Yang Li:
> Could anyone advice how to generate variable name with a incremental
> counter in it.
> What I intend to do is:
> local i=0
> gen var'i'=a-b (suggestion required)
> i=i+1
>
> Best Regards,
> Yang
if for example i shuld go from 1 to 1o the following will work:
forvalues i=1/10 {
gen var`i'=a-b
}
--
Peter Parzer
Zentrum f�r Psychosoziale Medizin
Klinik f�r Kinder- und Jugendpsychiatrie
Blumenstra�e 8, D-69115 Heidelberg
Tel.: +49/6221/56-6940, Fax: +49/6221/56-6941
*
* 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/