BookmarkSubscribeRSS Feed
deedilidee
Calcite | Level 5

Hello all!

Im in need of help on a certain area in SAS and hope to find it here.

I have data om patients and their number of readmissions in to a hospital. The patients ID repeats several times according to each new readmission date e.g

ID                              read_date

1                               11Jun2009

1                               01Jan2010

1                               23Feb2010

2                               30Nov2011

2                               21Dec2009

....

Each patient/ID has different inclusion dates (date as to when they were included in the study)

My question is; is there a way for me to only keep the readmissions from each patient one year from their respective inclusion dates?

Thanks!

3 REPLIES 3
JBerry
Quartz | Level 8

Are you dealing with another dataset? or just this one.

In the case of the example above, how do you know which date is the one you want to use as your 1 year starting point? Is it always the earliest one?

deedilidee
Calcite | Level 5

Hi, I think I've figured it out. As said before the data was these two variables including a variable for each called ''inclusiondate'' so it would look like this:

ID                              read_date                        inclusion_date

1                               11Jun2009                       09Jan2008

1                               01Jan2010                       09Jan2008

1                               23Feb2010                       09Jan2008

2                               30Nov2011                       08Feb2008

2                               21Dec2009                       08Feb2008

....

I decided at the end to just subtract the two dates from each other and eliminate all the observations that had over 365 days in between.

Thanks for your reply but I hope my ''simple'' method would be enough for now.

JBerry
Quartz | Level 8

Sounds like a good solution to me! Glad you figured it out  :smileycool:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1548 views
  • 0 likes
  • 2 in conversation