Have: - 4 variables for CD4 count (CD4_1, CD4_2, CD4_3 CD4_4) - 4 variables for the date when the CD4 count was measured (CD4_date1, CD4_date2, CD4_date3, CD4_date4) - 1 variable specifying the start date of the study period (start_sp) - 1 variable specifying the end date of the study period (end_sp) Want to create 3 new dichotomous variables: - CD4_1000, indicates if the individual had a CD4 count less than 1000, with the date of the test falling between the start and end of the study period (start_sp and end_sp) - CD4_500, indicates if the individual had a CD4 count less than 500, with the date of the test falling between the start and end of the study period (start_sp and end_sp) - CD4_350, indicates if the individual had a CD4 count less than 350, with the date of the test falling between the start and end of the study period (start_sp and end_sp) My question is how to create these 3 variables without a paragraph of if then's. This creates the 3 variables, but only incorporates the counts of the tests, not the dates: array CD4 [*] CD4Count; CD4_350 = 0; CD4_500 = 0; CD4_1000 = 0; do i = 1 to dim(CD4); if CD4[i] < 350 then CD4_350 = 1; if CD4[i] < 500 then CD4_500 = 1; if CD4[i] < 1000 CD4_1000 = 1; end; How can I modify this to include the requirement that the date of the test had to occur within the study period?
... View more