Hi, I've struggle to get an answer to this elsewhere however I'm sure it will be I just can't get my head around what I need to do.
This is an example dataset
ID Date of hospital admission Other variables x y z
A1 1/1/13
A1 1/1/14
A1 1/2/14
A2 2/2/13
A2 2/2/10
A3 2/2/18
A3 5/5/20
A4 1/2/13
I want the data to look like
ID First hospital admission Other variables x y z
A1 1/1/13
A2 2/2/10
A3 2/2/18
A4 1/2/13
I've got thousands of observations so can't just do manually.
Any ideas to code it would be much appreciated.
This is an example dataset
ID Date of hospital admission Other variables x y z
A1 1/1/13
A1 1/1/14
A1 1/2/14
A2 2/2/13
A2 2/2/10
A3 2/2/18
A3 5/5/20
A4 1/2/13
I want the data to look like
ID First hospital admission Other variables x y z
A1 1/1/13
A2 2/2/10
A3 2/2/18
A4 1/2/13
I've got thousands of observations so can't just do manually.
Any ideas to code it would be much appreciated.

Comment