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]

st: RES: label variables


From   "Henrique Neder" <[email protected]>
To   <[email protected]>
Subject   st: RES: label variables
Date   Tue, 3 Dec 2013 11:03:33 -0200

Lisa

You can define drugsN by:

gen drugsN = 1 if drugsN01 == 1
replace drugsN = 2 if drugsN02 == 1    
...
replace drugsN = 7 if drugsN02 == 7    

and then, you have to use the label define command like this:

label define <labelname> 1 "drugsN01" 2 "drugsN02" ... 7 "drugsN07", add
label values drugsN labelname

Henrique


-----Mensagem original-----
De: lisa wallner [mailto:[email protected]] 
Enviada em: terça-feira, 3 de dezembro de 2013 05:14
Para: [email protected]
Assunto: st: label variables

Dear Statalist,  

I have panel data for the years 2005-2010 and variables called drugsN,
drugsN01, drugsN02,..., drugsN07. As drugsN01 to drugsN07 are subgroups of
drugsN, I would like to have these subgroups as labels for the drugsN
variable. 
Unfortunately I don?t know how to that. Anyone a glue about it?   

Thx in advance! 
Lisa 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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