Date: Mon, 8 Sep 2008 08:31:38 -0700
Reply-To: snoopy369@GMAIL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: snoopy369@GMAIL.COM
Organization: http://groups.google.com
Subject: Re: Alternate for retain
Content-Type: text/plain; charset=ISO-8859-1
On Sep 8, 10:17 am, pausha <paus...@gmail.com> wrote:
> i have this dataset its clinical
>
> which has like 100 week visit and it slike for every 8 weeks my nee
> dis i have to put a flag for subject who have switched in dose after
> week 52.
> the scenario is they could have switched dose even before week 52 but
> i have to consider only afetr week 52
> dataset is like
> sub visit dose
> 001 week 50 30mg
> 001 week 51 60mg
> 001 week 76 60mg
> 001 week 80 60mg
>
> in this case his flag should be 'No' because his change is not after
> week 52
>
> sub visit dose
> 002 week 35 30mg
> 002 week 52 60mg
> 002 week 58 90mg
>
> in this case his flag is 'Yes' because his dose had incresed from 60
> to 90 after week 52
>
> each subjec have like 10 records so i need to use anythinng other than
> reatin and first.sub
>
> any different ideas appreciated for this look check and flagging.
> Thanks
Sounds like the easiest way to do this is (assuming 'visits' is the
dataset above):
proc sort data=visits; by sub visit dose; run;
data flags;
set visits;
by sub visit dose;
if first.dose /* and not first.sub */ and visit > 52 then flag =
"yes"; *this assumes visit is a numeric field, you need to use substr
or whatever if it actually contains "week 52";
run;
with optionally a check for first.sub if you want to not flag people
whose first visit was after week 52 (if that's possible in your
study), as they'd flag on their first dose without that check. I
don't think a retain would be necessary.
|