Date: Fri, 3 Dec 2010 22:30:32 -0500
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject: Re: How to detect multiple drug groups
I am assuming you want to count patient who ever took either statins or ACE
in this new group?
data new;
do until (last.id);
set old;
by id;
if drug_group='STATIN' then statin=1;
...
end;
STATIN_ACE = STATIN or ACE ;
run;
proc means data=new;
var statin ace statin_ace ... ;
output out=counts sum= ;
run;
On Fri, 3 Dec 2010 21:38:45 -0500, Dave <david.brewer@UC.EDU> wrote:
>Hi All,
>
>I am creating drug groups based on generic drug codes (GDC). I am using a
>format to create my four different drug groups: Statin, Betablockers, ACE,
>and ASA.
>
>I need to create another group called "Statin and ACE". I am counting the
>number of patients who fit into these categories but I am having trouble
>on how to create this last group.
>
>Here's a very simple example of my data:
>
>ID DRUG_GROUP DATE
>1 STATIN 10/1/2010
>1 BETABLOCKER 10/13/2010
>2 STATIN 09/03/2010
>2 ACE 09/14/2010
>3 BETABLOCKER 07/08/2010
>
>How would I recategorize ID=2 drug group to be in my new "Statin and ACE"
>group?
>
>Thanks.
>Dave
|