Statalist


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

Re: st: RE: Scoring


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Scoring
Date   Thu, 15 Nov 2007 12:39:01 +0000 (GMT)

--- Ziad El-Khatib <Ziad.El-Khatib@ki.se> wrote:
> Scoring = to have sum of n pills at week 24.
> Week 24 data is included, i.e.
> 4,8,12,16,20 & 24

*----------------- begin example -------------
drop _all
input studyid     week    npill1      npill2
1001          4         1             1
1001          8         0             1
1001          12        0             0
1001          16        0             0
1001          20        0             0
1001          24        0             0
1002          4         1             1
1002          8         0             1
1002          12        0             0
1002          16        0             0
1002          20        1             0
1002          24        1             0
end

gen npill1_2 = npill1 + npill2
egen tpill1 = total(npill1), by(studyid)
egen tpill2 = total(npill2), by(studyid)
egen tpill1_2 = total(npill1_2), by(studyid)
list, clean
*------------------- end example ---------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten



-----------------------------------------
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/
-----------------------------------------


      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  http://uk.promotions.yahoo.com/forgood/environment.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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index