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

Re: st: ? loop


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: ? loop
Date   Wed, 15 Oct 2003 14:50:04 +0100

Saranava, 

Probably something like this will work:
gen threedrugs=.
replace threedrugs=1 if cya==2|aza==2|predk==2 & cya!=.|aza!=.|predk!=.
replace threedrugs==0 if threedrugs==.

basically, your new variable threedrugs will have a coding of 1 if patients receive 1, 2 or 3 drugs and coding zero if they don't receive any or data is missing. Alternatively you can split that into three variables defining whether they receive 1,2 or 3 drugs

Hope that helps

Dev



Dev Vencappa
School of Economics
University of Nottingham
University Park
Nottingham
NG7 2RD
U.K.
Tel : +44 (0)115 951 5608
Fax: +44 (0) 115 951 4159
>>> [email protected] 10/15/03 2:30 PM >>>
Hello Statalist
I have data on various immunosuppression therapies coded as 1 or 2 or missing(eg given below), where 1=no and 2=yes.
	+---------------------------------------+
	cya   aza   pred2   okt_p   mmf   tli 
	---------------------------------------
1.	2     2       2       1     1     1 
2.	2     2       2       1     1     1 
3.	2     2       2       .     1     . 
4.	2     2       2       1     1     1 
5.	2     2       2       1     1     1 
	---------------------------------------
6.	2     2       2       1     1     1 
7.	2     2       2       1     1     1 
8.	2     1       2       1     2     1 
9.	2     2       2       1     1     1 
10.	2     2       2       1     1     1 
	+---------------------------------------+
I need to summarise this into a variable by patients receiving 1 or 2 or 3 or more type of drugs into a variable. Say all patients in the above example dataset will be receiving 3 drugs, with information on the missing being omitted.  Any pointers or help will be appreciated.
Thanks for your time in advance
ganesh

Mr J Saravana Ganesh FRCS(Ed. & Glasg.)
Clinical Research Fellow
UK Cardiothoracic Transplant Audit
Clinical Effectiveness Unit
The Royal College of Surgeons of England
35-43 Lincoln's Inn Fields
London WC2A 3PE
Phone: 02078696620
Fax: 02078696644
[email protected]

This e-mail and any attached files are confidential and are intended
solely for the use of the individual or entity to whom they are
addressed.

This communication represents the originators personal views and
opinions, which do not necessarily reflect those of The Royal College of
Surgeons of England.

If you are not the intended recipient, or the person responsible for
delivering the e-mail to the intended recipient, be advised that you
have received this e-mail in error, and that any use, dissemination,
forwarding, printing or copying of this e-mail is strictly prohibited.

http://www.rcseng.ac.uk

Registered Charity Number: 212808


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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