Date: Fri, 16 Jun 2006 22:09:38 -0400 Arthur Tabachneck "SAS(r) Discussion" Arthur Tabachneck Re: Calculating number of events and time to event To: sghate@GMAIL.COM

Sam,

I presume that no one has responded for a number of reasons:

(1) there are numerous examples, similar to yours, in the archives and can be readilly found with a simple search (2) your data looks like it has errors (e.g., the second date is for the year 2005) (3) you don't explain why does the first date shows 30 days and the last date (within an id) shows 150 days (i.e., what determines the end for the last period) (4) why is days_event, in your example, 90 rather than 60 days.

In short, reasonable data and more carefully thoughout explanations, would help.

Art -------------- On Fri, 16 Jun 2006 13:59:46 -0700, sam <sghate@GMAIL.COM> wrote:

>Hello, > >I was wondering if I could get some help from the SAS experts on this >group. I am working on a medical database and am trying to calculate >number of events and time to each particular event and also difference >in 2 events if any. I have explained this in more detail below. > >heres an example of the dataset I have > >id# Dose RxDate >1 100 1/1/2005 >1 100 2/1/5005 >1 200 3/1/2005 >1 300 4/1/2005 >1 100 5/1/2005 >2 100 2/1/2005 >2 100 3/1/2005 > >In the above dataset I have prescription claims of patients for one >year. The variable "Dose" is the dose of the prescription drug that was >filled on "RxDate". >You will notice from the variable Dose that the dose for patient 1 goes >up from 100 to 200 and to 300 and falls to 100 again. > >Now from these 2 variables (Dose and RxDate) I want to calculate the >number of such events (which is change in dose upward or downward) >denoted by the variable Titration. >Also, I would like to calculate the number of days to this event from >the first "Rxdate" denoted by "Days". > >In addition to the "Days" it would also be interesting to look at the >difference in the number of days between such events. for ex. number of >days for titration 1 (which is 90) and days between titration 1 and 2 >(which is 30); and number of days between titration 2 and 3 (60). > >The following dataset looks like the one I want > >id# Dose RxDate Titration days days_event >1 100 1/1/2005 0 30 - >1 100 2/1/5005 0 60 - >1 200 3/1/2005 1 90 90 >1 300 4/1/2005 2 120 30 >1 100 6/1/2005 3 150 60 > > >Any input from you guys would be greatly appreciated. > >thanks

Back to: Top of message | Previous page | Main SAS-L page