Hello All,
I'm not sure if this has been posted before as I'm not quite sure how to search for it either way. I have a dataset of participants who receive case management. Case manager enter progress notes for each participant. I want to compute the avg number of progress notes across all active participants for each quarter. I can compute the number progress notes per quarter, not a problem. However, I have the enroll date and discharge date. I need to somehow tag each participant for each quarter of interest (as active) before I can include them in the average calculation for each quarter. I plan to use their enroll and discharge date, along with the known dates for each quarter to determine if they were active. I expect that I can use for loops, along with the tq function to do this but I can't figure out the right approach yet.
Thanks,
Ben
I'm not sure if this has been posted before as I'm not quite sure how to search for it either way. I have a dataset of participants who receive case management. Case manager enter progress notes for each participant. I want to compute the avg number of progress notes across all active participants for each quarter. I can compute the number progress notes per quarter, not a problem. However, I have the enroll date and discharge date. I need to somehow tag each participant for each quarter of interest (as active) before I can include them in the average calculation for each quarter. I plan to use their enroll and discharge date, along with the known dates for each quarter to determine if they were active. I expect that I can use for loops, along with the tq function to do this but I can't figure out the right approach yet.
Thanks,
Ben
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(id dis_date initial_enroll_date) 779 22987 22858 137 22987 22922 441 22987 22950 901 23246 22847 117 . 22984 333 . 22977 692 . 23028 871 . 23028 977 . 23043 432 23246 23090 end format %dM_d,_CY dis_date format %dM_d,_CY initial_enroll_date
Comment