Identifying events that will happen multiple time and information about each

Reply
Contributor
Posts: 20

Identifying events that will happen multiple time and information about each

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
PROC Star
Posts: 325

Re: Identifying events that will happen multiple time and information about each

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

Contributor
Posts: 20

Re: Identifying events that will happen multiple time and information about each

[ Edited ]

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
Super User
Posts: 19,770

Re: Identifying events that will happen multiple time and information about each

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

 

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

Ask a Question
Discussion stats
  • 3 replies
  • 140 views
  • 1 like
  • 3 in conversation