Hello,
I would like some advice on how to get a summary stat from a dataset that is a bit complicated. In this dataset, each row is a medical record. There is a column called id where the person's id number is displayed but the same id does appear more than once, meaning the same person may have several medical records. I need to find the median number of records per person. (To be clear I need 1 number representing the average number of records a person in this dataset has.)
I have tried using egen to create groups based on id as well as the collapse command but so far have not been able to figure this out. I would appreciate any help!
Thank you,
Elaine
I would like some advice on how to get a summary stat from a dataset that is a bit complicated. In this dataset, each row is a medical record. There is a column called id where the person's id number is displayed but the same id does appear more than once, meaning the same person may have several medical records. I need to find the median number of records per person. (To be clear I need 1 number representing the average number of records a person in this dataset has.)
I have tried using egen to create groups based on id as well as the collapse command but so far have not been able to figure this out. I would appreciate any help!
Thank you,
Elaine
Comment