Statalist


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

Re: st: AW: label define


From   Miranda Kim <[email protected]>
To   [email protected]
Subject   Re: st: AW: label define
Date   Wed, 11 Nov 2009 11:43:14 +0000

Thank you so much!

Martin Weiss wrote:
<>


*************
clear*
set obs 1
gen byte var= 4

label define agegrp 1 "17-24" 2 "25-34" 3 "35-44" 4 "45-54" 5 "55-63"
la val var agegrp
ta var
lab copy agegrp agegrp2

lab def agegrp2 4 ">=45" 5 "", modify
la li _all
la val var agegrp2
ta var
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Miranda Kim
Gesendet: Mittwoch, 11. November 2009 12:24
An: [email protected]
Betreff: st: label define

A basic question...
How can I create a new label set for the values of a variable, by modifying an old one?
For example if I have:
label define agegrp 1 "17-24" 2 "25-34" 3 "35-44" 4 "45-54" 5 "55-63"

and I want to create a new label set with a different name, say agegrp2 that has the following values:
1 "17-24" 2 "25-34" 3 "35-44" 4 ">=45"

Can I use the label set agegrp with the option modify, to create a new label set rather than just overwriting the agegrp label?

Many thanks for your help!

*
*   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/


*
*   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/



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index