Date: Fri, 25 Jan 2008 14:51:34 -0800
Reply-To: gopilth@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: gopilth@YAHOO.COM
Organization: http://groups.google.com
Subject: Calculating time intervals
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I need to calculate the time intervals for each visit from the day of
diagnosis.
Pt may have multiple visits with the same diagnosis and also other
visits with a different diagnosis.
Following is the type of data I have.
Pt diag_dt serv_dt visit_typ
1 22jan07 23jan07 hiv
1 22jan07 13frb07 sup
1 22 jan07 20mar07 tot
1 22jan07 30mar07 hiv
1 22jan07 03jul07 sup
1 22jan07 20jul07 tot
2 10feb07 15feb07 tot
2 10feb07 01mar07 hiv
2 10feb07 25mar07 tot
2 10feb07 03apr07 tot
2 10feb07 15may07 sup
2 10feb07 25jul07 hiv
2 10feb07 10aug07 sup
3 15feb07 25feb07 sup
3 15feb07 30mar07 hiv
3 15feb07 15apr07 hiv
3 15feb07 25may07 tot
For example pt " 1" in the above example has total of 6 visits 2 for
hiv treatment, 2 for supportive care and two for other reasons.
From this I want to calculate the time intervals between each visit
for all 3 types of visits i.e Time b/w diag_dt and 1st serv_dt for
tot
Time b/w diag_dt and 2nd serv_dt for tot
Time b/w diag_dt and 3rd serv_dt for tot and soon... until
last visit date.
Then for
Time b/w diag_dt and 1st serv_dt for hiv
Time b/w diag_dt and 2nd serv_dt for hiv
Time b/w diag_dt and 3rd serv_dt for hiv and soon... until
last visit date.
Then for
Time b/w diag_dt and 1st serv_dt for sup
Time b/w diag_dt and 2nd serv_dt for sup
Time b/w diag_dt and 3rd serv_dt for sup and soon... until
last visit date.
I hope this is clear. Thanks in advance
Gopi