Statalist


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

Re: st: Part II - Chosing minimum value out of 6 variables


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Part II - Chosing minimum value out of 6 variables
Date   Tue, 27 May 2008 08:30:34 +0100 (BST)

Given all the answers you have received on very similar problems you
should be able to figure this one out by now. Take a good look at those
previous answers and at -help by- and -help egen-.

-- Maarten

--- Ziad El-Khatib <[email protected]> wrote:

> Hi again,
> managed to select the min value of adherence to drugs, thank you
> again!
> I created value adherentmin with value =1 if the minimum value was
> between 95-110, otherwise the value =0.
> 
> I am trying to score the adherentmin over the first 7 visits (visits
> 2,4,8,12,16,20 & 24), to see how the percentage of adherence during
> these visits, example below
> 
> id     visit     adherentmin     scoremin
> 1       0             .                    .
> 1       2            1                     57
> 1       4             0                    57
> 1       8             0                    57
> 1      12            1                    57
> 1       16           1                    57
> 1       20           0                    57
> 1       24          1                     57
> 1       36          .                      .
> 1       40          .                      .
> 2         0          0                     .
> 2          2          0               etc...
> 
> 
> 
> scoremin=(sum of adherentmin if visit>=2&visit<=24)*100/7
> 
> Any tips?
> 
> 
> Thank you and best regards
> ziad
> 
> 
> 
> On Mon, May 26, 2008 at 8:08 AM, Svend Juul <[email protected]> wrote:
> > Ziad wrote:
> >
> > I have adherence level for 6 different drugs (drug1, drug2, etc..),
> > inside cohort datafile, followed over 12 months.
> > At every visit there are data for 3 out of 6 drugs and I want to
> have
> > new variable having the minimal value for drug adherence, example
> > below
> >
> > id  visit  drug1  drug2  drug3  drug4  drug5  drug6  minval
> > 1       2     10     20     30      .      .      .      10
> > 2       2     40     30      .     50      .      .      30
> > etc..
> >
> > ================================================================
> >
> > egen minval = rowmin(drug1-drug6)
> >
> > Svend
> > ________________________________________________________
> >
> > Svend Juul
> > Institut for Folkesundhed, Afdeling for Epidemiologi
> > (Institute of Public Health, Department of Epidemiology)
> > Vennelyst Boulevard 6
> > DK-8000 Aarhus C,  Denmark
> > Phone, work:   +45 8942 6090
> > Phone, home:   +45 8693 7796
> > Fax:           +45 8613 1580
> > E-mail:        [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/
> >
> 
> 
> 
> -- 
> Ziad El-Khatib
> AIDS Unit
> National Institute for Communicable Diseases (NICD)
> 1 Modderfontein Road
> Private Bag X4, Sandringham, 2131
> Johannesburg, South Africa
> Mobile: +27 (0) 72-52 39 716
> Phone: +27 (0) 11-386 6433
> Fax (NICD): +27 (0)11 386 6453
> Fax (connected to my email): +27 (0)86 18 2871
> http://www.nhls.ac.za/div_nicd.html
> 
> Division of International Health (IHCAR)
> Karolinska Institutet
> www.phs.ki.se/ihcar
> *
> *   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/
> 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
*
*   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