Hi,
I have a data set in which there are multiple observations (i.e. indicated by time of arrival) for the same patient, and right now, my data set has observations (for the same patient) on different rows. I would like the observations to be on the same row. Every patient may have a different number of observations (i.e., patient 1 has 3 observations, patient 2 has 2 observations, patient 3 has 5 observations, etc). There are some duplicate rows. However, there are some observations (i.e., indicated by time of arrival) may have different chief complaints and/or ICD codes. For example:
ID Date/Time of Arrival Chief Complaint ICD
1 11/18 10:00 am Chest pain X10
1 11/18 10:00 am Back ache X10
1 11/20 11:00 am Headache X11
2 11/13 10:00 am Chest pain X12
1) How do I get rid of duplicate rows?
2) How do I transform multiple observations into one patient row (accounting for the fact that there may be different chief complaints - for the same visit time -- on different rows)?
Thanks!!
Tasha
I have a data set in which there are multiple observations (i.e. indicated by time of arrival) for the same patient, and right now, my data set has observations (for the same patient) on different rows. I would like the observations to be on the same row. Every patient may have a different number of observations (i.e., patient 1 has 3 observations, patient 2 has 2 observations, patient 3 has 5 observations, etc). There are some duplicate rows. However, there are some observations (i.e., indicated by time of arrival) may have different chief complaints and/or ICD codes. For example:
ID Date/Time of Arrival Chief Complaint ICD
1 11/18 10:00 am Chest pain X10
1 11/18 10:00 am Back ache X10
1 11/20 11:00 am Headache X11
2 11/13 10:00 am Chest pain X12
1) How do I get rid of duplicate rows?
2) How do I transform multiple observations into one patient row (accounting for the fact that there may be different chief complaints - for the same visit time -- on different rows)?
Thanks!!
Tasha
Comment