Dear reader,
I tracked executives across firms and retained those individual executives who were employed for at least three years in each of at least two different firms. Although it is possible that teams of executives move from firm to firm, this should not happen in exactly the same years. These executives need to be dropped because this contains perfectly collinear executives. To make this more clear I added an example from Stata.
As you can see executives (3018 and 2972) moved from company A (1177) to company B (1500) in exactly the same year (2001). In my dataset, this might also occur for more than two executives at the same time. In case a team exists of 3 executives and 2 of the executives move to the same firm in the same year, then I still need to remove those 2 executives. Since I am interested in individual changes only. I am searching for a code to remove those teams of executives, satisfying the above condition.
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input long(GVKEY1 EXECID2) double YEAR
1164 607 1998
1164 607 1999
1164 607 2000
1164 607 2001
1164 18563 2002
1164 18563 2003
1164 18563 2004
1177 3018 1992
1177 3018 1993
1177 3018 1994
1177 3018 1995
1177 2972 1992
1177 2972 1993
1177 2972 1994
1177 2972 1995
1500 3018 2001
1500 3018 2002
1500 3018 2003
1500 3018 2004
1500 2972 2001
1500 2972 2002
1500 2972 2003
1500 2972 2004
Related Posts with Tracking changes in dataset with condition
Selectively dropping 1 of 2 similar variables measured on the same dateData cleaning question: I have a longitudinal data set from 2009 to 2020 involving children and adol…
Question on bar graph (percentages of answer options) by group for more than 3 variablesHi all I am fairly new to Stata and the forum, I hope the way I described my problem is ok! Thank …
Event History Analysis vs. LogitI have a conundrum regarding a policy analysis I'm running. I have a variable stateorder that is cod…
Summary stat. to excelDear All, I would like to export my results to an excel sheet. I tried this code below but it did n…
Help with small sample panel data with cross-sectional dependenceI'm using the CCE estimation technique for a research work. My dataset consists of eight cross-secti…
Subscribe to:
Post Comments (Atom)
0 Response to Tracking changes in dataset with condition
Post a Comment