I have a dataset that contains lab tests performed on a set of patients. Each observation is one test (they're all the same test), performed on one patient.
Variables are: patient ID, patient sex, patient YOB, doctor ID, and quarter (i.e. the quarter year that the test was performed in, with values 1-40, as the data spans 10 years).
I now want to look at the doctors testing behaviour, and produce the following table:
Thus, by quarter and doctor ID i want to look at summary statistics. I have been trying to create these outcomes by using the collapse command, but have had no luck so far.
Can anyone help me on how to write the command to get the results for my table? I then want to make the same tables by sex and age categories, so maybe collapse isn't the fasest way because I would lose my patient sex and YOB data.
Thanks!
Variables are: patient ID, patient sex, patient YOB, doctor ID, and quarter (i.e. the quarter year that the test was performed in, with values 1-40, as the data spans 10 years).
I now want to look at the doctors testing behaviour, and produce the following table:
Median number of tests performed per Doctor |
IQR | Range of number of tests performed per doctor (min-max) |
Number of doctors who ordered 0 tests |
Number of distinct doctors who ordered a test in this quarter | |
Q1 2011 | |||||
Q2 2011 | |||||
Q3 2011 | |||||
Q4 2011 | |||||
Q1 2012 | |||||
...etc |
Thus, by quarter and doctor ID i want to look at summary statistics. I have been trying to create these outcomes by using the collapse command, but have had no luck so far.
Can anyone help me on how to write the command to get the results for my table? I then want to make the same tables by sex and age categories, so maybe collapse isn't the fasest way because I would lose my patient sex and YOB data.
Thanks!
Comment