Hello
I would be very grateful for your advice. My data is in long format. I would like to keep the first observation only where ExamDate occurs after dob. I generated "date" which =. if dob precedes ExamDate. "n" just indexes id ("number") for each time point. In the data below, I would like to keep lines 2 and 11.
Many thanks!
HTML Code:
[HTML][CODE] | number ExamDate~B dob date n | |--------------------------------------------| 1. | 11003 9/28/1995 02 Apr 96 . 1 | 2. | 11003 4/18/1996 02 Apr 96 1 2 | 3. | 11003 10/9/1996 02 Apr 96 1 3 | 4. | 11003 4/17/1997 02 Apr 96 1 4 | 5. | 11003 5/8/1998 02 Apr 96 1 5 | 6. | 11003 3/15/1999 02 Apr 96 1 6 | 7. | 11003 3/23/2000 02 Apr 96 1 7 | 8. | 11003 3/16/2001 02 Apr 96 1 8 | 9. | 11003 7/9/2004 02 Apr 96 1 9 | 10. | 11005 9/27/1995 16 Apr 96 . 1 | 11. | 11005 5/7/1996 16 Apr 96 1 2 | 12. | 11005 10/16/1996 16 Apr 96 1 3 | 13. | 11005 4/21/1997 16 Apr 96 1 4 | 14. | 11005 4/2/1998 16 Apr 96 1 5 | 15. | 11005 3/16/1999 16 Apr 96 1 6 | 16. | 11005 3/23/2000 16 Apr 96 1 7 | 17. | 11005 3/13/2001 16 Apr 96 1 8 | [/CODE]
Comment