Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: add index to the names of some variables


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Re: add index to the names of some variables
Date   Tue, 13 Jul 2004 12:41:17 -0700 (PDT)

Oleksandr,

You don't need the double quotes.

foreach var of varlist a-d {
  rename `var'  `var'_i
}

Friedrich Huebler

--- Oleksandr Shepotylo <[email protected]> wrote:
> I would like to add index i to some variable names. What is wrong
> with my code:
> 
> variables: id a b c d
> 
> foreach var of varlist a-d {
>   rename "`var'"  "`var'""_i"
> }



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index