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?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.