Statalist


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

RE: st: Rename variables to reflect values?


From   Roy Wada <[email protected]>
To   <[email protected]>
Subject   RE: st: Rename variables to reflect values?
Date   Thu, 4 Jun 2009 22:24:59 -0700

> 
> Does anyone have a suggestion for how I could rename my variables to 
> reflect the values in an observation or a variable? Or any other 
> suggested shortcuts, short of making this long local macro?
>
> Jennifer

sysuse auto, clear
drop make headroom gear_ratio
foreach var of varlist _all {
   ren `var' `var'`=`var'[1]'
}
 
Roy
 
_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index