Hello,
I have a dataset with the following structure.
What I want to do is keep only those observations with a day_01 to day_05 value of "1" for any day between the exposure_start and exposure_end.
I would like to do this for each Participant_ID. The exposure_start and exposure_end values are unique to each participant_id
Any ideas?
Here is the code for this sample dataset:
data have;
input WELL_ID DAY_01 DAY_02 DAY_03 DAY_04 DAY_05 EXPOSURE_START $ EXPOSURE_END $ PARTICIPANT_ID;
FORMAT WELL_ID z14.;
datalines;
01133244410000 0 0 1 0 0 DAY_01 DAY_05 1
02019220960000 0 0 0 0 0 DAY_01 DAY_05 1
07167297020000 1 0 0 0 0 DAY_01 DAY_05 1
17067210480000 0 0 0 0 0 DAY_01 DAY_05 1
34000000000000 0 0 0 0 0 DAY_01 DAY_05 1
34001200010000 0 0 0 0 0 DAY_02 DAY_04 2
34001200020000 0 0 0 0 0 DAY_02 DAY_04 2
34001200030000 0 0 0 1 0 DAY_02 DAY_04 2
34001200040000 0 0 0 0 0 DAY_02 DAY_04 2
34001200050000 0 0 0 0 0 DAY_02 DAY_04 2
;
run;