Can you help me program this algorithm that is giving me trouble?
I have a dataset (as the one I've attached) with patient ID and the difference in days between two dates, with a range of -21 to +7.
I need to identify patients who have two consecutive values of flag_KPI = 1 within the range [-21, 0).
If they have only one in the range [-21, 0), then I consider the case where they have two consecutive values of flag_KPI = 1, one in the window [-21, 0) and the other in the window [0, 7].
retain by creating two counters (one for days < 0 and one for days ≥ 0), but I wasn’t successful.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.