Hello all,
I have a large database, and I'm trying to apply a function based on the value of a string variable (patient_id):
I want a command to replace cand2 to 0 if variable days is negative or below a certain threshold for all patient_id with the same value.
Thank you so much. I'm really struggling and I have not come even close
Warmly,
Andres
I have a large database, and I'm trying to apply a function based on the value of a string variable (patient_id):
patient_id | encounter_id | candidiasis | event_date2 | dx_date2 | days | cand2 |
EAPH | HQMLW | 1 | 13-Jan-23 | 24-Aug-21 | -507 | 1 |
EAPH | HwULW | 1 | 13-Jan-23 | 13-Sep-23 | 243 | 1 |
EAPH | HQOLW | 1 | 13-Jan-23 | 27-Jan-22 | -351 | 1 |
I want a command to replace cand2 to 0 if variable days is negative or below a certain threshold for all patient_id with the same value.
Thank you so much. I'm really struggling and I have not come even close
Warmly,
Andres
Comment