Hello every SAS programmers, I have one troublesome question which need your talented expertise to solve it. We can see the first picture. There are several variables.(id, metformin, SU, acar,meg and its start day and censor day) And I want to find the overlapped period for metformin and other variables. I also restrict the period must contain metformin and other one variable. That is to say, i restrict the period must only contain metformin+SU/acar/meg. Then i will name the start of the period as index day and the end of the period will be named as censor day. The samples below can help you understand my definition. And after find the index day and censor day, i still have one small problem. Take ex.3 as sample. Because the person has three medications(metfomrin,SU,TZD),therefore the variables will be "1". However, because of the period(index day to censor day) only contain Metformin and TZD, thus I hope that SU can change to "0" and Metformin,TZD still be "1". The following picture is the result i want. I have to apologize for the lengthy problem... The problem have bothered me a long time but i still can't figure out the solution. Hope you can understand and solve my question. Very very very very thank you!!!!!!
... View more