I new to create a new variable that identifies subgroups within a larger group based on dates. I pasted a table below to better illustrate what I mean.
I have tried multiple approaches, unsuccessfully. Any suggestions?
Thank you very much!
I have tried multiple approaches, unsuccessfully. Any suggestions?
Thank you very much!
ID | Date | New group variable |
1 | 01/01/01 | 1 |
1 | 01/01/01 | 1 |
1 | 05/03/10 | 2 |
1 | 05/03/10 | 2 |
2 | 07/02/05 | 1 |
2 | 07/02/05 | 1 |
3 | 12/03/08 | 1 |
3 | 12/03/08 | 1 |
4 | 06/18/03 | 1 |
4 | 06/18/03 | 1 |
4 | 06/18/03 | 1 |
4 | 01/07/12 | 2 |
Comment