I would like to calculate a overlap rate (or you can treat it as a change rate) for focal firms' peer group from year to year. the data is something like this:
focal_firm peer_firm year
001 021 2000
001 022 2000
001 021 2001
001 022 2001
001 023 2001
001 021 2002
001 023 2002
001 024 2002
002 021 2000
002 024 2000
002 022 2001
002 024 2001
002 022 2002
002 024 2002
......
I would like to check how peer group change compared with previous year. For example, for focal firm 001, its peer group similarity is 2/3 (2 same peer firms / 3 peer firms in total on 2001) from year 2001 to year 2002.
one of the biggest problem is I do not know how to set time series variable (focal_firm year) when there is duplicates.
Thank you very much for your help!
Best,
Yongda
focal_firm peer_firm year
001 021 2000
001 022 2000
001 021 2001
001 022 2001
001 023 2001
001 021 2002
001 023 2002
001 024 2002
002 021 2000
002 024 2000
002 022 2001
002 024 2001
002 022 2002
002 024 2002
......
I would like to check how peer group change compared with previous year. For example, for focal firm 001, its peer group similarity is 2/3 (2 same peer firms / 3 peer firms in total on 2001) from year 2001 to year 2002.
one of the biggest problem is I do not know how to set time series variable (focal_firm year) when there is duplicates.
Thank you very much for your help!
Best,
Yongda
Comment