Statalist


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

st: Date calculation


From   "Ziad El-Khatib" <Ziad.El-Khatib@ki.se>
To   statalist@hsphsun2.harvard.edu
Subject   st: Date calculation
Date   Sat, 27 Oct 2007 11:32:44 -0700

Hi!
we observed patients at different time points and it is numbered under
'visit' variable as
1,2,3,4,5

And we know the date of each visit (variable named 'date')

I am trying to calculate the number of days between visits for each
patient. Patients can be identified after their studyid.

For example, my aim is to have something as below

studyid           visit        date                             days
1001                1           01-01-2000                    0
1001                 2          15-01-2000                    14
1001                3            20-01-2000                   5

etc..


days is the new variable i aim to create etc...


Any tips?


Thank you 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