Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Gen & replace


From   "Ziad El-Khatib" <Ziad.El-Khatib@ki.se>
To   statalist@hsphsun2.harvard.edu
Subject   st: Gen & replace
Date   Thu, 1 Nov 2007 15:19:26 -0700

Dear STATA lister
it might be simple question, but spent sometimes on it so far.
I want to calculate sum of missed pills on 3 out of 5 drugs (drug1,
drug2..drug5).
Main drugs are drug1 and drug2, and the combination is either:
adherence level of:
drug1 + any 2 out of drug3,4,5
or
drug2 ?  any 2 out of drug3,4,5

All of these drugs have value 0 when they were not used.

i thought first to add them by typing
gen drugsum = drug1+drug2+drug3+drug+4drug5
I assume i will get total sum, but when i do ratio, STATA count with
patients with dug value 0.

Any tips how to exclude counting patients with drug value = 0?


Thank you in advance and best regards
ziad
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index