This is probably a very simple question, but I cannot figure it out. I have data where each row is a unique outcome for a person. The people in the dataset all have a unique identifer (Unique ID).
I want to create a second (not unique) identifier (Date ID) in a new column that is the first date that person appears in the data. I would like to do this in Stata, and if it is impossible I guess Excel would be alright.
For example I have:
Unique ID Date Outcome
1 1/1/2000 A
2 2/11/2003 B
2 2/12/2003 B
2 3/6/2004 A
3 4/4/1997 A
3 8/11/2011 A
4 9/16/1995 B
4 9/17/1995 B
4 9/18/1995 C
4 9/19/1995 E
4 9/20/1995 A
4 2/17/1996 A
4 9/16/1996 A
4 9/17/1996 B
5 10/16/1995 C
5 10/17/2005 C
5 12/31/2008 A
I want:
Unique ID Date Outcome Date ID
1 1/1/2000 A 1/1/2000
2 2/11/2003 B 2/11/2003
2 2/12/2003 B 2/11/2003
2 3/6/2004 A 2/11/2003
3 4/4/1997 A 4/4/1997
3 8/11/2011 A 4/4/1997
4 9/16/1995 B 9/16/1995
4 9/17/1995 B 9/16/1995
4 9/18/1995 C 9/16/1995
4 9/19/1995 E 9/16/1995
4 9/20/1995 A 9/16/1995
4 2/17/1996 A 9/16/1995
4 9/16/1996 A 9/16/1995
4 9/17/1996 B 9/16/1995
5 10/16/1995 C 10/16/1995
5 10/17/2005 C 10/16/1995
5 12/31/2008 A 10/16/1995