LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 4 Aug 2006 05:23:58 -0700
Reply-To:     Arjen <a.benedictus@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arjen <a.benedictus@GMAIL.COM>
Organization: http://groups.google.com
Subject:      merging tables
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I am developing a procedure for data-based disease classification of individual patients. Currently I am working out a way to define the prognosis of a patient.

/*I have a table called Master that contains a list of the classification variables:*/

data Master; Length Serology1 Serology2 Biochemical_criteria $50; INPUT Serology1 $ Serology2 $ Biochemical_criteria $ ; CARDS;

Positive High None Negative Low Present Unknown Unknown . ;

RUN; /*From this table I create a table Matrix that contains all possible combinations of outcomes for the variables in Master:*/

proc sql; create table Matrix as select a.Serology1, b.Serology2, c.Biochemical_Criteria from Master a, master b, master c where c.Biochemical_Criteria ne ' ' order by a.Serology1, b.Serology2, c.Biochemical_Criteria ;

quit;

/*This table Master is exported to Excel and handed over to a team of medical experts. For every combination of variables (18 in this case) these experts define a prognosis. E.g.: "The prognosis of this patient is not so good because he showed positive on Serology1 and Serology2." Now suppose that during this process the medical experts decide that the matrix has to be updated. For instance, for Serology2 an additional outcome "Very_High" has to be added. The Master table will then come to look like this:

data Master; Length Serology1 Serology2 Biochemical_criteria $50; INPUT Serology1 $ Serology2 $ Biochemical_criteria $ ; CARDS;

Positive High None Negative Low Present Unknown Unknown . . Very_High . ;

RUN;

/*And the Matrix like this*/

proc sql; create table Matrix as select a.Serology1, b.Serology2, c.Biochemical_Criteria from Master a, master b, master c where a.Serology1 ne ' ' and c.Biochemical_Criteria ne ' ' order by a.Serology1, b.Serology2, c.Biochemical_Criteria ;

quit;

/* The matrix now has increased to 24 rows of combinations. 18 of these combinations have already been "seen" by the medical experts, but 6 of them have not (these are the rows that include "Very_High" for Serology2). What I want is to integrate the filled 18-row table (imported from Excel) with the 24-row table in a way that the medics will have to fill only the remaining 6 empty prognoses. I figure it can be done by assigning a unique code to each of the combinations, where every variable-outcome would be assigned a number 1, 2 3 or 4. The combinations positive-high-none would then have 111, and positive-high-present would have 112. And then merge tables by code. But how to assign this codes?

Btw, I need this format in order to convert it to an outline and finally to a graphical decision tree for presentation purposes. */


Back to: Top of message | Previous page | Main SAS-L page