Statalist


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

st: Date & if function


From   Ziad El-Khatib <[email protected]>
To   [email protected]
Subject   st: Date & if function
Date   Wed, 15 Aug 2007 01:47:42 -0700

Hi again,
I want to calculate the number of days elapsed between date of
patients visits to the clinic, patients are expected to come each 4th
week, i.e. week4, week8, week12 etc..
I have date of visit (var date) and dummy variable for weeks, i.e.
week4 (1 or 0), week8 (1 or 0)

I am trying to generate new variable to calculate n of days between
week8 and week4, by saying
dayat8 = (date if week4==1) - (date if week8==1)
it does not work

Any tips?
Thank you in advance and best regards
ziad









-- 
Ziad El-Khatib
National Institute for Communicable Diseases (NICD)
South Africa

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