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)
Dynamic panel quantile regression with fixed effectsHi all, I am studying the impact of quality of institutions on carbon emissions. I would like to kn…
Understanding Abadie, Athey, Imbens, and Wooldridge (2017) using a long-difference exampleThere are 100 counties j. There are many people in each county. People do not move across counties f…
Adding the average of a variable as a new categoryHi, My apologies if this has been asked before, I'm just sure how to explain it, so I'm showing the…
Using esttab to report results for Lagged VariablesHi All, My dataset resembles the following (I have panel data, so multiple observations for the sam…
Differentiating between different types of farmers - how can I find out exactly how many?Hi Statalist! I was wondering if anyone could help me, I am new to Statalist and I can’t seem to fi…
Subscribe to:
Post Comments (Atom)
0 Response to Summation of data before and after an event (dummy variable)
Post a Comment