Hi,
I need help joining two datasets by a range of dates. I have a date of a procedure (svcdate) and I want to make sure patients have enrollment in insurance at least 3 months after their procedure date (svcdate). For the enrollment data, I have a start and end date (dtstart and dtend). Any suggestions on how I should do this? I tried joinby but I could not get the code to work for me.
thank you
I need help joining two datasets by a range of dates. I have a date of a procedure (svcdate) and I want to make sure patients have enrollment in insurance at least 3 months after their procedure date (svcdate). For the enrollment data, I have a start and end date (dtstart and dtend). Any suggestions on how I should do this? I tried joinby but I could not get the code to work for me.
thank you
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str9(dtstart dtend) "01-JUN-19" "30-JUN-19" "01-SEP-19" "30-SEP-19" "01-JUL-20" "31-JUL-20" "01-OCT-20" "31-OCT-20" "01-MAY-19" "31-MAY-19" "01-SEP-20" "30-SEP-20" "01-AUG-20" "31-AUG-20" "01-APR-20" "30-APR-20" "01-FEB-19" "28-FEB-19" "01-DEC-19" "31-DEC-19" "01-OCT-19" "31-OCT-19" "01-NOV-19" "30-NOV-19" "01-DEC-20" "31-DEC-20" "01-FEB-21" "28-FEB-21" "01-JAN-20" "31-JAN-20" "01-MAR-20" "31-MAR-20" "01-JAN-21" "31-JAN-21" "01-FEB-20" "29-FEB-20" "01-MAR-19" "31-MAR-19" "01-JUL-19" "31-JUL-19" "01-MAY-20" "31-MAY-20" "01-APR-19" "30-APR-19" "01-AUG-19" "31-AUG-19" "01-JUN-20" "30-JUN-20" "01-NOV-20" "30-NOV-20" end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str9 svcdate "13-SEP-20" "29-JUL-20" "29-JUL-20" "13-SEP-20" "29-JUL-20" "29-JUL-20" "13-SEP-20" "13-SEP-20" "29-JUL-20" "29-JUL-20" "29-JUL-20" "13-SEP-20" "29-JUL-20" "13-SEP-20" "29-JUL-20" "29-JUL-20" "29-JUL-20" "13-SEP-20" "29-JUL-20" "13-SEP-20" "13-SEP-20" "29-JUL-20" "29-JUL-20" "13-SEP-20" "29-JUL-20" end
Comment