Bookmark and Share

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]

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


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
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" 
}

Nick 
[email protected] 

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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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