Date: Wed, 23 Jan 2008 04:50:47 -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: Re: Selecting pts with only cancer diagnosis
Content-Type: text/plain; charset=ISO-8859-1
On Jan 22, 11:05 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote:
> Gopi,
>
> If, in your example, you want to identify patients 25 and 31, then
> something like the following will work:
>
> data have;
> input pt diacod;
> cards;
> 11 200
> 11 120
> 11 120.2
> 20 220
> 20 120.1
> 20 120.9
> 31 120
> 22 217.9
> 22 120.8
> 22 542.9
> 25 120.6
> 25 120.9
> 25 120
> ;
>
> proc sort data=have;
> by pt;
> run;
>
> data want (keep=pt);
> set have;
> retain hiv other;
> by pt;
> if first.pt then do;
> hiv=0;
> other=0;
> end;
> if diacod in (120,120.1,120.2,120.3,120.4,120.5,
> 120.6,120.7,120.8,120.9) then hiv=1;
> else other=1;
> if last.pt and hiv and not(other) then output;
> run;
>
> If you don't like the above method, you could also use proc transpose,
> sql, arrays, or a hash.
>
> HTH,
> Art
> -----------
>
>
>
> On Tue, 22 Jan 2008 18:56:58 -0800, gopi...@YAHOO.COM wrote:
> >Hi,
> >Iam trying to clean data for some analysis and want to select only the
> >patients who have HIV only and no other infectious disease based on
> >the diagnosis code.In other words I want pts with diagnosis code
> >120,120.1,120.2....120.9(all these codes are for hiv) and exclude
> >every person with a different diagnosis code as well as if they have
> >any other diagnosis code along with HIV diag code. The data set I have
> >is something like this.
>
> >pt diacod
> >11 200
> >11 120
> >11 120.2
> >20 220
> >20 120.1
> >20 120.9
> >31 120
> >22 217.9
> >22 120.8
> >22 542.9
> >25 120.6
> >25 120.9
> >25 120
>
> >Thanks in advance.
> >Gopi.
>
> >.- Hide quoted text -
>
> - Show quoted text -
Thank you.
|