Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: automatic transfer of variable labels

From   Declan Trott <[email protected]>
To   [email protected]
Subject   st: automatic transfer of variable labels
Date   Wed, 16 Apr 2003 16:57:53 +1000

This is probably impossible, but when I create new variables by renaming or transforming old ones, I would like to be able to give the new variables the same variable labels as the old ones without having to type out "label variable varname text" for each new variable.

eg I have a collection of information on different houses and the variable "x" is the number of bedrooms. First I want to rename x as something more intuitive:

generate bedrooms = x

And then I create dummy variables for each value of bedrooms that occurs in the data:

tab bedrooms, generate(bedrooms)

Is there any way that I can give each of the bedrooms dummies (bedrooms1, bedrooms2 etc) the same variable label as x without having to type the "label . . ." command individually for each one?

Probably impossible since variable labels, unlike value labels, aren't defined with names of their own independent from the variable they are attached to.


* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index