Hi
I have a data where there are several observations (in this case diagnosis codes) for each patientid and admissiondate.
ie
patid diagnosis admissiondate
1 heart failure 1jan02
1 diabetes 1jan02
1 angina 8march07
1 bowel obstruction 10oct11
2 hypertension 9sept04
2 hernia 9sept04
3 renal failure 08aug21
3 head injury 07jun23
3 diabetes 07jun23
4 appendicitis 11march05
4 migraine 11march 05
i want to eventually make this data wide so the patid with same admission dates are all on one row. first I would like to number the admission dates for each patient so all the admission dates on 1st jan will be 1 and next admission 2 and so forth. Would anyone be able to help with this syntax?
Many thanks
I have a data where there are several observations (in this case diagnosis codes) for each patientid and admissiondate.
ie
patid diagnosis admissiondate
1 heart failure 1jan02
1 diabetes 1jan02
1 angina 8march07
1 bowel obstruction 10oct11
2 hypertension 9sept04
2 hernia 9sept04
3 renal failure 08aug21
3 head injury 07jun23
3 diabetes 07jun23
4 appendicitis 11march05
4 migraine 11march 05
i want to eventually make this data wide so the patid with same admission dates are all on one row. first I would like to number the admission dates for each patient so all the admission dates on 1st jan will be 1 and next admission 2 and so forth. Would anyone be able to help with this syntax?
Many thanks
Comment