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:

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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