- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
All-
I am trying to figure out the most efficient way to code for a "clean period," or a 6 month time period in which x=0.
there are three variables of interest for each observation
trigger date
claim date
x= 0 or 1
I'd like to make a new variable that flags the observation if x =1 and the time interval between the trigger date and the claim date is 6 months or less. INTCK doesn't seem appropriate because neither date is standardized. someone mentioned that PROC SQL "date matching" may be the right function, but I can't find syntax for that. any ideas?
Thank you!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what you mean by standardized date. If your dates are SAS dates, this would work:
data want;
set have;
back_pn_6_mo_event =
back_pn and
intck("MONTH", claim_date, trigger_date, "CONTINUOUS") <= 6 ;
run;
If your dates are not SAS dates, then make them so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you supply sample input and desired output data it would help to visualize your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
input:
trigger-date claim_date back_pn
1/13/13 2/13/12 1
1/13/13 4/20/12 0
1/13/13 7/25/12 0
1/13/13 10/15/12 1
2/18/13 8/19/12 0
2/18/13 9/8/12 1
3/12/13 11/30/12 1
3/12/13 12/13/12 1
3/12/13 12/28/12 1
output
trigger-date claim_date back_pn back_pn_6_mo_event
1/13/13 2/13/12 1 0
1/13/13 4/20/12 0 0
1/13/13 7/25/12 0 0
1/13/13 0/15/12 1 1
2/18/13 8/19/12 0 0
2/18/13 9/8/12 1 1
3/12/13 11/30/12 1 1
3/12/13 12/13/12 1 1
3/12/13 2/28/12 1 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what you mean by standardized date. If your dates are SAS dates, this would work:
data want;
set have;
back_pn_6_mo_event =
back_pn and
intck("MONTH", claim_date, trigger_date, "CONTINUOUS") <= 6 ;
run;
If your dates are not SAS dates, then make them so.