input long(pat_key collection_day_number) str8 collection_time_of_day float(plt hemoglobin)
494211883 2 "06:03:00" 0 0
494211883 1 "16:24:00" 0 9.3
494211883 2 "06:03:00" 0 8.1
494211883 2 "06:03:00" 0 0
494211883 4 "06:22:00" 0 8.1
494211883 3 "05:35:00" 0 7.1
end
[/CODE]
------------------ copy up to and including the previous line ------------------
Hey all, new Stata user here. I have a massive dataset that I am working with and really struggling with the next step in my coding. I am working with data on surgeries. Each surgical case has lab values collected posteroperatively each day. Each surgical case is identified by an ID number which in the case I posted is 494211883. I want to merge rows of the data together based on the day postoperatively the labs were collected. For instance I want all rows with a a collection time of day of "2" to be merged together, all with a collection time of 3 to be merged together and so on and so forth. How would I go about doing this?
Comment