Hello! I am a novice user and have looked through the forum for hours trying to find a solution to this problem to no avail. I have survey health data for over 200,000 individuals (each row represents a unique individual) and I would like to create a simple comorbidity index. I have 9 variables (columns) representing 9 medical conditions (all binary numeric, coded as 0 = no and 1 = yes), and would like to create a new variable which tells me how many individuals report having 0, 1, 2, 3 or 4 or more medical conditions. I'm sorry I don't know how to add a sample of the data! This is as far as I've gotten - creating a new variable that is able to indicate that a person has all 9 comorbid diseases, or none of the 9 diseases. I'm stuck at being able to indicate if they have three of the 9 diseases, how to indicate comorbid = 3, and if they have any two of the 9 diseases, how to indicate comorbid = 2, etc.... DATA CP;
SET M.CP;
COMORBID = .;
IF (EVER_ASTHMA = 1) AND (EVER_EMPHYS =1) AND (EVER_CB =1) AND (EVER_DIAB=1) AND (EVER_TB=1) AND (EVER_HD=1) AND (EVER_MIOC=1) AND (EVER_RESP=1) AND (EVER_HBP=1) THEN COMORBID = 9;
IF (EVER_ASTHMA = 0) AND (EVER_EMPHYS =0) AND (EVER_CB =0) AND (EVER_DIAB=0) AND (EVER_TB=0) AND (EVER_HD=0) AND (EVER_MIOC=0) AND (EVER_RESP=0) AND (EVER_HBP=0) THEN COMORBID = 0; RUN; Thanks in advance!
... View more