Hi,
I have a loop inside a loop so that I can merge a file into another file by several different variables (I have data on cities, and I need to merge in the data on cities by each city crossed in each observation).
Right now I have the following code:
forvalues p=1/55 {
use C:\filename.dta
foreach var in capital spending investment transfers ...
ren `var' `var'_`p'
save C:\filename.dta
..and then I open up the master data and merge in the renamed variables.
}
}
The problem is that stata will only rename the first variable in my variable list--here capital, it ignores the other variables.
How do I fix this?
Thanks.
Molly
____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
*
* 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/