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

st: RE: Renaming variables to its variable label


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Renaming variables to its variable label
Date   Tue, 30 Nov 2004 15:10:16 -0000

In general, there's no guarantee that a
variable label contains a legal variable
name, but something like this should 
help, plugging in your own substitute
for <varlist> 

foreach v of var <varlist> { 
	capture rename `v' `: var label `v'' 
} 

Nick 
[email protected] 

Van Campenhout Bjorn
  
> i would like to know if there is a quick way to rename variables to
> their own variable labels.  

*
*   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