Date: Mon, 30 Nov 1998 10:09:03 -0600
Reply-To: "Liu, Liyan HSURC" <liul@SDH.SK.CA>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Liu, Liyan HSURC" <liul@SDH.SK.CA>
Subject: Re: hospital discharge
Content-Type: text/plain
Thanks for all who kindly provided codes regarding how to delete transfers.
I appreciate all your help.
Have a great day!
Liyan
Liyan Liu
Research Officer
Health Services Utilization and Research Commission (HSURC)
Box 46, 103 Hospital Drive
Saskatoon, SK Canada S7N 0W8
tel: (306) 655-1523
fax: (306) 655-1462
e-mail: liul@sdh.sk.ca
website: http://www.sdh.sk.ca/hsurc/
> ----------
> From: David
> Yeates[SMTP:david.yeates@HEALTH-CARE-EPIDEMIOLOGY.OXFORD.AC.UK]
> Reply To: David Yeates
> Sent: November 30, 1998 5:18 AM
> To: SAS-L@UGA.CC.UGA.EDU
> Subject: Re: hospital discharge
>
> <<File: no transfers.LOG>><<File: no transfers.LST>>
> In article <912319396.1115259.0@vm121.akh-wien.ac.at>, Liu, Liyan HSURC
> <liul@SDH.SK.CA> writes (in part...)
>
> >I am working with hospital discharge data. I'd like to create a subset
> >excluding transfers(admitted to another hospital within one day of
> >discharging from the former hospital, in the data below, ID 1 and 3 were
> >transferred cases).
> >
> >My question is: how to delete the 2 records with * attached. Retain or
> lag
> >command?
> >
> >id date of admission date of discharge
> >1 23/01/97 25/01/97 *
> >1 26/01/97 30/01/97
> >2 13/03/97 20/03/97
> >2 25/03/97 27/04/97
> >3 08/01/97 09/01/97
> >3 14/09/97 17/09/97 *
> >3 18/09/97 20/09/97
>
> which can be achieved in one way as :-
>
> SAS code begins -->
>
> /* SORT the dataset in to id and chronological order */
>
> proc sort data=admins;
> by id admdate;
> run;
>
> /* Exclude transfer records from the dataset (<2 days) */
>
> data notrans;
> retain curdisch;
> set admins;
> by id;
> if (first.id) then curdisch=disdate;
> else if ((admdate-curdisch)<2) then delete;
> else curdisch=disdate;
> run;
>
> The SAS log and listing file are attached.
>
> Regards...
> David
> --
> UHCE, Oxford University
> mailto:david.yeates@uhce.ox.ac.uk
>
>
|