Date: Sat, 14 Oct 2006 17:31:43 -0400
Reply-To: Roland Rivers <seatedcoin@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland Rivers <seatedcoin@GMAIL.COM>
Subject: Re: A Treatment Assignment Problem
Sorry for the multiple posts. I corrected typo in Subject and a new topic
was created. Anyway here is my original problem. Please see the first post
with actual more complicated data. A few people have offered solutions but
those don't seem to be working with the actual data just the sample data.
========================================================================
This is a pharmaceutical treatment assignment problem.
At a Doctor office visit a patient is assigned a given treatment. In between
visits the patients can take one of 3 treatments (A,B,C) and may switch back
and forth between the 3 treatments per Doctor's orders. For statistical
analysis purposes for each visit interval a patient will be assigned the
first treatment they took during that interval.
Here is example Input data:
Visit Schedule File
Patient Visit Visit Date
1 1 05/01/06
1 2 06/26/06
1 3 07/30/06
1 4 08/30/06
Treatment Start and Stop Dates File
Patient Treatment Start Date Stop Date
1 A 5/01/06 5/25/06
1 B 5/26/06 6/01/06
1 C 6/02/06 6/24/06
1 B 6/25/06
Dersired Output File:
Patient Visit Interval Treatment Start Date Stop Date
1 12 A 5/01/06 5/25/06
1 23 B 6/25/06
1 34 B 6/25/06
Between Visit 1 and Visit 2 (5/01/06-06/26/06) the patient took treatments
A, B, C and then back to B. For Visit Interval 1-2 (12 for shorthand) the
specs require that the first treatment that the patient took during that
interval be assigned which in this case is treatment A. Between Visits 2 and
3 (23) the patient is assigned treatment B which he started on 6/25/06 and
is still taking. Likewise Visit Interval 34 will be assigned treatment B
because he never ended that treatment. Based upon the specs I describe how
would I get the desired output file above?
Thanks from a struggling newbie!