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

st: RE: RE: ? loop

From   "Ganesh, Saravana" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: ? loop
Date   Wed, 15 Oct 2003 15:05:45 +0100

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

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 

[email protected] 

*   For searches and help try:
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

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.

Registered Charity Number: 212808

*   For searches and help try:

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