Hey everyone, I have to do some analysis on a pharmaceutical dataset. By selecting the right interval I lack the right idea for continuing. I would be grateful if someone could help me 🙂 My data: I am working with a dataset which contains measurements (like temperature, weight etc.) from patients over different timepoints. Patient Day Parameter Value 1 1 Temperature 37 2 38.5 3 39 4 - 5 - 6 35.9 7 38 8 - 9 - 10 38.5 11 - 12 39.3 13 - 14 38 15 - 16 36.9 17 - 2 1 - ... ... 23 37.6 My task: For my analysis I want to determine a 14-days interval in which at least 7 values are not missing. I am starting with the measurement on the last day (so first I sort the dataset in descending sequence). therefore for patient 1 with the intervall [Day 17 to Day 4]. In this example the interval doesn't contain 7 non-missing values. So I have to move the interval from [Day 17 to 4] to [Day 16 to 3] and have to check the number of non-missing values again. Now there are 7 non-missing values in the interval, I can give out the start and end day of the interval and use it for analysis. So all in all, I start with the interval [last Day - (last Day - 14)] and move it forward until I reach an interval which contains at least 7 non-missing values. This interval should be determined for each patient and each parameter. My solution: First I sort the dataset in descending sequence. After that I have transpose the dataset twice - for the variable Day and Value. Then I have created two arrays - _days and _values. Now I count the missing values in the interval from position 1 to 14. If the value is greater than 7, then I have to move the interval. I have tried to realize it with a do-while loop. Does everyone has an idea how to solve that problem? Thanks for your help! Kind regards, Saskia
... View more