LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Nov 2007 12:17:26 -0500
Reply-To:     George Joseph <gjman@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         George Joseph <gjman@HOTMAIL.COM>
Subject:      Re: Tricky Retain Step

The data is at the rx level, I have not yet merged with the visit data. So every obs is an rx (and we have millions of them).

I was thinking more in the lines of retaining the first rx for a given Patient (N=1) and then when N=3 (for the patient) comparing 3 to 1 and if thats the same then retain the previous Rx (N=2) and comparing it to N=4 (for the patient) if both these are EQ then that the end of that.

The data is sorted BY Patient start_date stop_date;

So simplistically, it is set in: by patient; if first.patient then do; Reset all the flags (repeat_rx,rx_change, dose_change) to zero. Set Prev_rx, Prev_strength to whatever is on first.patient values are.

Else do; if rx NE prev_rx then rx_change=1; if rx EQ prev_rx and strength NE prev_strenght then dose_change=1; end;

Obviously in the original example for Patient 1, _N_=1 and _N_=3 & _N_=2 and _N_=4 are the same and hence repeating. Just donno how to check for that.


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