In my dataset I have multiple observations for each IDs, sometimes even multiple observations each day. I am looking at counting the number of observations each day for each ID but I would like a modified data variable. Instead of looking at number of observations from midnight of one day to midnight of the next, I would like to look 3am to 3am for each date in the dataset. Any hints on how to do this?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str7 clinicID float(date time firstintake) byte daily_reg float days_enrolled "M003834" 22770 1.967388e+12 22770 1 2 "M003834" 22771 1.967449e+12 22770 1 2 "M003984" 22768 1.967232e+12 22764 1 8 "M003984" 22764 1.9668427e+12 22764 1 8 "M003984" 22764 1.966843e+12 22764 1 8 "M003984" 22765 1.9669305e+12 22764 1 8 "M003984" 22769 1.9672747e+12 22764 1 8 "M003984" 22764 1.9668423e+12 22764 1 8 "M003984" 22768 1.9671887e+12 22764 1 8 "M003984" 22766 1.967021e+12 22764 1 8 "M003984" 22771 1.9674477e+12 22764 1 8 "M003984" 22770 1.9673656e+12 22764 1 8 end format %td date format %tcHH:MM time format %td firstintake

Comment