Thank you Nick. Your suggestion worked exactly as I wanted it.
-----Original Message-----
From: Nick Cox [mailto:[email protected]]
Sent: Wednesday, October 15, 2003 2:54 PM
To: [email protected]
Subject: st: RE: ? loop
This could be classified as a question on multiple responses
in the sense of http://www.stata.com/support/faqs/data/multresp.html
If you just want to count therapies used,
egen ntherapies = neqany(cya aza pred2 okt_p mmf tli), val(2)
tab ntherapies
If you want to keep track of which are used,
gen therapies = ""
foreach v of var cya aza pred2 okt_p mmf tli {
replace therapies = therapies + "`v'" if `v' == 2
}
tab therapies
Nick
[email protected]
*
* 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/
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/