Hello, This is something I've been struggling with about a month now and am not making any headway. Here is the problem. I have identified groups across three different sets of years. I have a unique id for each group-year, but the group-ids are not consistent across time, and the group membership can change slightly over time. I need to have a way of identifying groups across years. For instance, A,B,C are group "1" in 2001, but in 2005, C spins off as a separate group "3", and A-B add D as a member and have group id number "2" in 2005. I need to find a way to capture the fact that Group 3 in 2005 is the same as group 1 in 2001 (since the majority of the members are the same). Any suggestions will be very much appreciated. See below the data structure:
Individual Id; Group Id; Year
A; 1; 2001
B; 1; 2001
C; 1; 2001
A; 2; 2005
B; 2; 2005
D; 2; 2005
C; 3; 2005
F; 3; 2005
A;6; 2009
B; 6; 2009
D; 6; 2009
C; 7; 2009
I've tried various iterations of the merge command and the bysort command, but haven't really made much headway.
Thanks
Individual Id; Group Id; Year
A; 1; 2001
B; 1; 2001
C; 1; 2001
A; 2; 2005
B; 2; 2005
D; 2; 2005
C; 3; 2005
F; 3; 2005
A;6; 2009
B; 6; 2009
D; 6; 2009
C; 7; 2009
I've tried various iterations of the merge command and the bysort command, but haven't really made much headway.
Thanks
Comment