BookmarkSubscribeRSS Feed
weweaw
Obsidian | Level 7
I really don't know where to begin but I've been trying and failing for days.  
The end is I need to count how many times type a happened 90 days before type b, but there cannot be any other type b's 90 days before.  I can do this if I'm only looking at one instance of type b.  I did then by adding a new var of the date of type b of a person's to all their other claims.  I have a very crude idea how to do this for all but I'm hoping for a more elegant solution.  Here are the funny parts of my data: type b can happen multiple times in the same claim so day and in that case I would treat it as one type b event.  A person can also have many type b's, I think it can be as high as 150 of them.  So I need to mark the b events that have no other b events 90 days before so then I can count the type a events that happened in that window.  In my real data type a can be many types and I will need to have how many time a type a happened and what category the type a was.  
 
ID Claim_ID Claim_line Date Type
1 1 1 11-Feb  a
1 2 1 11-Mar   b
1 2 2 11-Mar  b
1 2 3 11-Mar  a
1 3 1 11-Jun  b
1 3 2 11-Jun  a
1 3 3 11-Jun  a
1 4 1 3-Jul  a
1 5 1 6-Jun  a
1 6 1 9-Sep  b
2 1 1 8-Aug  a
2 2 1 10-Sep  b
2 3 1 30-Nov  a
2 4 1 11-Dec  b
3 REPLIES 3
kiranv_
Rhodochrosite | Level 12

can you also please show how your output looks like for a particular scenario.

weweaw
Obsidian | Level 7

I added a few rows to show when there is a type b within 90 days of another and how then the type a would not count and type be would be marked as bad.

I'm not even for sure but I think this would do it.  I will need to be able to calculate what is the average number of a's for each good b event and also what is the total good type a's.

ID Claim_ID Claim_line Date Type Type_b_good typeb_number in_90_good
1 1 1 11-Feb a . . 1
1 2 1 11-Mar b 1 1 0
1 2 2 11-Mar b 0 2 0
1 2 3 11-Mar a . . 1
1 3 1 11-Jun b 1 3 0
1 3 2 11-Jun a . . 0
1 3 3 11-Jun a . . 0
1 4 1 3-Jul a . . 0
1 5 1 6-Jul a . . 0
1 6 1 9-Sep b 1 4 0
2 1 1 8-Aug a . . 1
2 2 1 10-Sep b . 1 0
2 3 1 30-Nov a . . 1
2 4 1 11-Dec b 1 2 0
2 5 1 12-Dec a . . 0
2 6 1 13-Dec b 0 3 0
Reeza
Super User

Search using either Google or the Forum: "30 day readmission" 

 

There are several methods that can be implemened - usually using SQL processing. 

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!

How to Concatenate Values

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.

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
  • 432 views
  • 1 like
  • 3 in conversation