Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Re-labelling multiple variables

From   Konrad <>
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.


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index