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, is already up and running.

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

RE: st:revise variables labels for a group of variables

From   Nick Cox <>
To   "''" <>
Subject   RE: st:revise variables labels for a group of variables
Date   Thu, 14 Oct 2010 18:12:34 +0100

See -help extended_fcn-. 

foreach of var frog toad newt whatever* { 
	label var `v' "`: var label `v'' revised" 


Amanda Fu

I was wondering if someone could give me some help with the variable labels.

I am recoding a group of variables (more than 10) by creating new
variables with the revised scales and keeping the original variables
as well. For the variable labels of the new variables, I would like to
define them as "original variable's labels + recoded".
What I have not figured out is how to import the original variable
labels and add "revised".

One way is to clone the new variable (--clonevar--)and then add a word
"revised" to the new labels. But I am stuck with how to change the
variable labels for a variable list together.

The following is an example of the two variables I would like to revise:

original variable  name:   educ
original variable label:     education level
recoded variable name:  educ_r
revised variable label:     education level revised

original variable  name:    mar
original variable label:      marital status
recoded variable name:   mar_r
revised variable label:      marital status revised

*   For searches and help try:

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