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

st: Date calculation

From   "Ziad El-Khatib" <>
Subject   st: Date calculation
Date   Sat, 27 Oct 2007 11:32:44 -0700

we observed patients at different time points and it is numbered under
'visit' variable as

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


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

Any tips?

Thank you and best regards
*   For searches and help try:

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