Hello Everyone! I have a dataset where each column represents a day. There are 1825 columns. Each row represents a patient. Each day that the patient had a medication there is a 1 in the column and 0 for the days when the patient took no medication. On the days when the patient took more than one medication, the column has the number of medications taken by the patient on that day (could be 2, 3, etc.) I am interested in identifying patients taking multiple medication (more than 1) on at least 60 consecutive days without a 31 day gap. From the start of the at least 60-day multiple medications episode, I need to follow the patient for a year (365 days). If the patient had multiple episodes within the 365-day period i.e.say 75 days multiple medications, then for 55 days just one medication and then 100 days of multiple medications again, I need to count those episodes, too. I need to report the number of episodes of multiple medications and mean length of each episode. Please could you help me with the code on this. This is a snapshot of my dataset. day1 day2 day3 day4 day5 day6 day7 day8 day9 day10 day11 day12 Patient1 1 1 1 1 1 2 2 2 2 2 2 2 Patient2 2 2 2 2 2 1 1 1 1 2 2 2 Thank you! Pooja Desai
... View more