Statalist


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

st: RE: Aggregate date to calculate n months


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Aggregate date to calculate n months
Date   Mon, 4 Aug 2008 16:33:15 +0100

My first tip is that you show us your code. We can't comment on
"problems" that aren't explained. 

My second tip is to look at the help, in this case for date functions. 

gen start = mdy(startm, startd, starty) may be a good start. 

Nick
[email protected] 

Ziad El-Khatib

I entered dates of patients starting on treatment and date of their
interview under different variables:

startd (for day)
startm (for month)
starty (for year)

surveyd (for day)
surveym (month)
surveyy (year)

Now i want to calculate number of months patients have been on
treatment.
I am finding problems in creating
start=startd+startm+starty
survey=surveyd+surveym+surveyy

period=survey-start

Any tips?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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