Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Re-labelling multiple variables
From
Konrad <[email protected]>
To
[email protected]
Subject
st: Re-labelling multiple variables
Date
Tue, 11 Jun 2013 00:58:24 +0100
Dear Statlist readers,
I would like to rename a set of variables by replacing a part of a string in variable label with another string. For instance, I imported a number of variables correponding to dependecy ratios. After the import each variable has a label grsapechildoldYEAR, I would like to replace first word with more meaningful text.
local changvrs grsapechildold2003 - grsapechildold2011
foreach var of varlist `changvrs' {
label `var' regexr(`var', "grsapechildold", "Dependency Ratio (%)")
}
I don’t know how to mix string replacement commands with variable labelling. As usual, any help will be appreciated.
--
Regards
Konrad
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/