hello - I'm stuck on something I was hoping to get some help with.
I am working with insurance claims data, in this case, the enrollment file. I have 48 months worth of data, and am trying to do two things:
1. for each id, determine whether the person had a continuous 12 or more month period of enrollment at any time during the 48 months, and if so, store the first and last months of enrollment (there may be gaps in enrollment, so a given id may have more than one 12+ month continuous period).
2. for each id, evaluate the dx_month, and see if the person had 12 months of continuous enrollment for the 12 months prior. So for a person diagnosed in month 13, was he continuously enrolled between months 1 and 12.
• dx_month = month during the 4-yr period that the person was diagnosed with hypertension
• e1-e26 = binary variables indicating enrollment during each month (1=yes). My dataset actually has e1-e48 but I didn't include all here.
data temp;
input id dx_month e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16
e17 e18 e19 e20 e21 e22 e23 e24 e25 e26;
cards;
101 13 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1
102 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
103 15 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
104 14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
105 22 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0
106 11 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
107 20 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Any help would be greatly appreciated. I've tried lags, macros, etc. but am not getting it to work.. 😞 Thank you.