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
Tags: None
Related Posts with Tracking changes in dataset with condition
Substring strvar into observations, not variablesDear Stata community, I have the following string variable r1etab that has multiple observations sep…
Recoding variables in loopsHi, I am trying to recode three sets of variables (u* v* x*) into different categories from newly ge…
Multiply entries of observationsHi, Please see below, how would I multiply the observation by the number that is stated as the vari…
Mean difference in metaanalysis stata13Hello statalist team!! I am using Sata13 for a metaanalysis. I use the command metan N1 varname1 sd1…
Dealing with Date variables in StataHello, I am using Stata 16.1 (MP). I have a date variable, which is stored as a numeric variable in …
Subscribe to:
Post Comments (Atom)
0 Response to Tracking changes in dataset with condition
Post a Comment