Hi fellow experienced researchers and STATA users,
I am trying to find the summation of a variable data (MA score) over t + 1 through t + 3 of an event (CEO turnover measured through a dummy variable, 1 for an actual turnover event) and t - 3 through t -1 (prior to the turnover event) over a large dataset. Later, I will need to find the difference between these pre and post event summations. Sample data example is given below:
input double year long gvkey double MA_SCORE_2018_w float turnover
1995 1004 -.0793594 1
1996 1004 -.0692754 0
1997 1004 .0072931 0
1998 1004 -.0387679 0
1999 1004 -.0730754 0
2000 1004 -.0696314 0
2001 1004 -.020128 0
2002 1004 -.0847194 0
2003 1004 -.0698555 0
2004 1004 -.0677616 0
2005 1004 -.0726101 0
2006 1004 -.0773012 0
2007 1004 -.0549248 0
2008 1004 -.089513 0
2009 1004 -.0799284 0
2010 1004 -.0529496 0
2011 1004 -.0370836 0
2012 1004 -.1311681 0
2013 1004 -.1212202 0
2014 1004 -.1385657 0
2015 1004 -.1532222 0
2016 1004 -.0984766 0
2017 1004 -.0913004 1
2000 1013 .084332 1
2001 1013 -.0619783 0
2002 1013 -.1163758 0
2003 1013 -.0692972 1
2004 1013 -.095181 0
2005 1013 -.0834125 0
2006 1013 -.1054572 0
2007 1013 -.0461751 0
2008 1013 -.0750284 0
2009 1013 -.076883 0
2010 1013 -.0043238 1
1993 1034 -.0377137 1
1994 1034 -.0202996 0
1995 1034 -.1025984 0
1996 1034 -.1042087 0
1997 1034 -.1417544 0
1998 1034 -.0760982 1
end
[/CODE]
The summation will be for the MA_score variable depending on the turnover dummy occurence. Looking forward to your assistance. Thanks in advance.
Related Posts with Summation of data before and after an event (dummy variable)
How to append a sub-set of observations.Hi everyone, So, I have a very large yearly database on students of different educational levels (3…
Interpretation Competing Risk (Stcrreg) – Comparability of CovariatesDear Stata Users, I have a question regarding the interpretation and comparability of the hazard ra…
How can these two datasets reshape between each other?Hi, I have two datasets linked below. Can anyone help me to reshape them between each other using S…
How do I store coefficients from GARCH model in a postfile Code: capture postutil clear postfile table1 arch using "vov.garch.dta", replace arch vov, arch(1…
Ommited Industry Diversification - Fixed Effects ModelDear all, according to Allayannis and Weston (2001) I am trying to do a fixed effects regression wi…
Subscribe to:
Post Comments (Atom)
0 Response to Summation of data before and after an event (dummy variable)
Post a Comment