Hello, I need to delete observations that have an activity session outside of 1 week from admit or discharge. My data look like the following:
(ID=subject, adate= admission date, ddate= discharge date, actdate= activity session date)
ID adate ddate actdate
1 1/3/2021 1/30/2021 1/11/2021
1 1/3/2021 1/30/2021 1/9/2021
2 1/4/2021 1/29/2021 1/28/2021
2 1/4/2021 1/29/2021 1/15/2021
What I want:
ID adate ddate actdate
1 1/3/2021 1/30/2021 1/9/2021
2 1/4/2021 1/29/2021 1/28/2021
Thank you!
No observation satisfies your condition, as in all either the adate or the ddate are more than one week from actdate.
Or did you mean: actdate must be between one week before adate and one week after ddate?
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.