i have a dataset of around 900,000 observations from about 130,000 ids. The variables i am working with are mostly dates. i wanted to take just the first event date that happened during 1 year period after the interview date. Some of the dates recorded can come from the events that happened before the interview date.
my data would look like this
ID | intdate | effdate1 | effdate2 | effdate3 | dureffdate1 | dureffdate2 | |
1 | 8/01/2010 | 28-Apr-10 | 28-Jul-11 | 110 | 566 | ||
2 | 30/08/2010 | 20-Dec-11 | 477 | ||||
3 | 6/01/2010 | 31-Jul-10 | 206 | ||||
4 | 13/01/2010 | 16-Apr-10 | 93 | ||||
5 | 4/08/2010 | 27-Jul-10 | 14-Apr-11 | -8 | 253 | ||
6 | 11/03/2010 | 22-Dec-10 | 286 | ||||
7 | 20/10/2010 | 23-Sep-10 | -27 | ||||
8 | 3/11/2010 | 8-Dec-11 | 400 | ||||
9 | 16/06/2010 | 6-Sep-11 | 447 | ||||
10 | 29/06/2010 | 6-Dec-10 | 25-Jan-11 | 160 | 210 | ||
11 | 1/11/2010 | 6-Oct-11 | 339 | ||||
12 | 15/02/2010 | 9-Aug-10 | 175 | ||||
13 | 12/11/2010 | 27-Sep-11 | 319 | ||||
14 | 2/02/2010 | 10-Mar-11 | 401 | ||||
15 | 14/02/2010 | 8-Aug-11 | 540 | ||||
i wanted to take just the first date of event which happened during 1 year period after intdate.
how do i do that without deleting other observations as i need them for other analysis.
thank you
0 Response to How to filter dates within an interval from a set of observation
Post a Comment