Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: rename


From   "Airey, David C" <david.airey@vanderbilt.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: rename
Date   Tue, 7 Aug 2012 12:27:13 -0500

.

With the new rename group command, can you use locals to rename a very
large number of variables from an old name set to a new name set where
there will be no stub used in either set?

The syntax is

rename (old1 old2) (new1 new2)

but can locals be used inside the parentheses to represent a long list
of variable names to be switched? I can generate the locals using code
rather than typing.

Otherwise, what is the best way to rename a whole bunch of variables
to new names where the variables do not have stubs.

I can do the renaming using a reshape and merge, but it seems clunky.


-Dave


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index