Help using Base SAS procedures

Keeping events within a given time frame?

Reply
New Contributor
Posts: 2

Keeping events within a given time frame?

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!

Contributor
Posts: 64

Re: Keeping events within a given time frame?

Posted in reply to deedilidee

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?

New Contributor
Posts: 2

Re: Keeping events within a given time frame?

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.

Contributor
Posts: 64

Re: Keeping events within a given time frame?

Posted in reply to deedilidee

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

Ask a Question
Discussion stats
  • 3 replies
  • 224 views
  • 0 likes
  • 2 in conversation