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?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.