Hi folks, consider the following data for which it logs blood pressure measures.
For each patientid, I want to keep only the earliest and latest BP readings of EACH DAY and disregards anything in between INTRADAY. So, for each day, I want to have only two observations of BP readings per patient. What if I want to keep three records (first, middle, last)?
For each patientid, how can I find how many logs each patient has recorded per day to see the summary statistics?
How would I go about doing this?
Many thanks!
For each patientid, I want to keep only the earliest and latest BP readings of EACH DAY and disregards anything in between INTRADAY. So, for each day, I want to have only two observations of BP readings per patient. What if I want to keep three records (first, middle, last)?
For each patientid, how can I find how many logs each patient has recorded per day to see the summary statistics?
How would I go about doing this?
Many thanks!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte patientid str14 time int sys byte dia 1 "2023-11-17 23 " 123 77 1 "2023-11-18 08 " 135 80 1 "2023-11-18 15" 128 70 2 "2023-11-11 23 " 117 68 2 "2023-11-18 08 " 160 100 3 "2023-11-05 23 " 155 90 4 "2023-11-21 23 " 140 88 4 "2023-11-22 07 " 121 72 4 "2023-11-23 15" 120 70 end

Comment