I am still learning Stata, currently using Stata 14.2.
Thank you very much in advance for your answer. I have a challenge with doing a Propensity Score matching and a parallel trend graph for a staggered DiD.
Here is my design: I want to examine the effect of the death of a company director on innovation for companies that experienced the death of such directors and those that did not experience death. The challenge is that the directors died in different years between my sample range of 2022 to 2020 (panel data). In the example below, the company "FOE" experienced the death of a director in 2002, while the company "GNTX" experienced death in 2006. Other companies in this hypothetical sample did not experience death within the sample range of 2022 to 2020.
As this is just an example, some companies in the main dataset experienced death in 2003, 2004, 2005, 2008, 2009, 2010, 2011, and 2012.
My questions are:
1. I will like to do a propensity score matching (PSM) and conduct a parallel trend test using a graph, as the number of control firms is much more in addition to other benefits of a PSM. How can I accomplish this with the staggering nature of the treatment?
2. How do I run a DiD effectively with this design?
Other notes:
Ticker = company identifier
fyear = fiscal year (sample year)
Treat = dummy 1 or 0 if a firm experienced death of director
deathyear = the year director died.
My setup for DiD period (post): pre-treatment and post-treatment is 4 years before death, death year, and 4 years after the death
Some steps I have taken
1. Obtained some codes for PSM and prepared a time variable showing -4, -3, -2, -1, 0 1, 2, 3, 4 for the pre and post period. But I realized that this time variable covered only the treatment group. How can I include a counterpart control group for each set of firms with a time range of -4 to 4? This time variable aims to get all firms together within a one-time range to conduct a PSM and then separate the time variable and do a parallel trend test. I note that Stata does not accept negative values (-4,-3) as values for categorical variables; what can I do about this?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str5 Ticker int fyear float Treat int deathyear "FOE" 2002 1 2005 "FOE" 2003 1 2005 "FOE" 2004 1 2005 "FOE" 2005 1 2005 "FOE" 2006 1 2005 "FOE" 2007 1 2005 "FOE" 2008 1 2005 "FOE" 2009 1 2005 "FOE" 2010 1 2005 "FOE" 2011 1 2005 "FOE" 2012 1 2005 "FOE" 2013 1 2005 "FOE" 2014 1 2005 "FOE" 2015 1 2005 "FOE" 2016 1 2005 "FOE" 2017 1 2005 "FOE" 2018 1 2005 "FOE" 2019 1 2005 "FOE" 2020 1 2005 "FITB" 2002 0 . "FITB" 2003 0 . "FITB" 2004 0 . "FITB" 2005 0 . "FITB" 2006 0 . "FITB" 2007 0 . "FITB" 2008 0 . "FITB" 2009 0 . "FITB" 2010 0 . "FITB" 2011 0 . "FITB" 2012 0 . "FITB" 2013 0 . "FITB" 2014 0 . "FITB" 2015 0 . "FITB" 2016 0 . "FITB" 2017 0 . "FITB" 2018 0 . "FITB" 2019 0 . "FITB" 2020 0 . "RF" 2002 0 . "RF" 2003 0 . "RF" 2004 0 . "RF" 2005 0 . "RF" 2006 0 . "RF" 2007 0 . "RF" 2008 0 . "RF" 2009 0 . "RF" 2010 0 . "RF" 2011 0 . "RF" 2012 0 . "RF" 2013 0 . "RF" 2014 0 . "RF" 2015 0 . "RF" 2016 0 . "RF" 2017 0 . "RF" 2018 0 . "RF" 2019 0 . "RF" 2020 0 . "TRMK" 2002 0 . "TRMK" 2003 0 . "TRMK" 2004 0 . "TRMK" 2005 0 . "TRMK" 2006 0 . "TRMK" 2007 0 . "TRMK" 2008 0 . "TRMK" 2009 0 . "TRMK" 2010 0 . "TRMK" 2011 0 . "TRMK" 2012 0 . "TRMK" 2013 0 . "TRMK" 2014 0 . "TRMK" 2015 0 . "TRMK" 2016 0 . "TRMK" 2017 0 . "TRMK" 2018 0 . "TRMK" 2019 0 . "TRMK" 2020 0 . "MTB" 2002 0 . "MTB" 2003 0 . "MTB" 2004 0 . "MTB" 2005 0 . "MTB" 2006 0 . "MTB" 2007 0 . "MTB" 2008 0 . "MTB" 2009 0 . "MTB" 2010 0 . "MTB" 2011 0 . "MTB" 2012 0 . "MTB" 2013 0 . "MTB" 2014 0 . "MTB" 2015 0 . "MTB" 2016 0 . "MTB" 2017 0 . "MTB" 2018 0 . "MTB" 2019 0 . "MTB" 2020 0 . "USB" 2002 0 . "USB" 2003 0 . "USB" 2004 0 . "USB" 2005 0 . "USB" 2006 0 . "USB" 2007 0 . "USB" 2008 0 . "USB" 2009 0 . "USB" 2010 0 . "USB" 2011 0 . "USB" 2012 0 . "USB" 2013 0 . "USB" 2014 0 . "USB" 2015 0 . "USB" 2016 0 . "USB" 2017 0 . "USB" 2018 0 . "USB" 2019 0 . "USB" 2020 0 . "FHN" 2002 0 . "FHN" 2003 0 . "FHN" 2004 0 . "FHN" 2005 0 . "FHN" 2006 0 . "FHN" 2007 0 . "FHN" 2008 0 . "FHN" 2009 0 . "FHN" 2010 0 . "FHN" 2011 0 . "FHN" 2012 0 . "FHN" 2013 0 . "FHN" 2014 0 . "FHN" 2015 0 . "FHN" 2016 0 . "FHN" 2017 0 . "FHN" 2018 0 . "FHN" 2019 0 . "FHN" 2020 0 . "FLO" 2002 0 . "FLO" 2003 0 . "FLO" 2004 0 . "FLO" 2005 0 . "FLO" 2006 0 . "FLO" 2007 0 . "FLO" 2008 0 . "FLO" 2009 0 . "FLO" 2010 0 . "FLO" 2011 0 . "FLO" 2012 0 . "FLO" 2013 0 . "FLO" 2014 0 . "FLO" 2015 0 . "FLO" 2016 0 . "FLO" 2017 0 . "FLO" 2018 0 . "FLO" 2019 0 . "FLO" 2020 0 . "FLR" 2002 0 . "FLR" 2003 0 . "FLR" 2004 0 . "FLR" 2005 0 . "FLR" 2006 0 . "FLR" 2007 0 . "FLR" 2008 0 . "FLR" 2009 0 . "FLR" 2010 0 . "FLR" 2011 0 . "FLR" 2012 0 . "FLR" 2013 0 . "FLR" 2014 0 . "FLR" 2015 0 . "FLR" 2016 0 . "FLR" 2017 0 . "FLR" 2018 0 . "FLR" 2019 0 . "FLR" 2020 0 . "F" 2002 0 . "F" 2003 0 . "F" 2004 0 . "F" 2005 0 . "F" 2006 0 . "F" 2007 0 . "F" 2008 0 . "F" 2009 0 . "F" 2010 0 . "F" 2011 0 . "F" 2012 0 . "F" 2013 0 . "F" 2014 0 . "F" 2015 0 . "F" 2016 0 . "F" 2017 0 . "F" 2018 0 . "F" 2019 0 . "F" 2020 0 . "FELE" 2002 0 . "FELE" 2003 0 . "FELE" 2004 0 . "FELE" 2005 0 . "FELE" 2006 0 . "FELE" 2007 0 . "FELE" 2008 0 . "FELE" 2009 0 . "FELE" 2010 0 . "FELE" 2011 0 . "FELE" 2012 0 . "FELE" 2013 0 . "FELE" 2014 0 . "FELE" 2015 0 . "FELE" 2016 0 . "FELE" 2017 0 . "FELE" 2018 0 . "FELE" 2019 0 . "FELE" 2020 0 . "BEN" 2002 0 . "BEN" 2003 0 . "BEN" 2004 0 . "BEN" 2005 0 . "BEN" 2006 0 . "BEN" 2007 0 . "BEN" 2008 0 . "BEN" 2009 0 . "BEN" 2010 0 . "BEN" 2011 0 . "BEN" 2012 0 . "BEN" 2013 0 . "BEN" 2014 0 . "BEN" 2015 0 . "BEN" 2016 0 . "BEN" 2017 0 . "BEN" 2018 0 . "BEN" 2019 0 . "BEN" 2020 0 . "FUL" 2002 0 . "FUL" 2003 0 . "FUL" 2004 0 . "FUL" 2005 0 . "FUL" 2006 0 . "FUL" 2007 0 . "FUL" 2008 0 . "FUL" 2009 0 . "FUL" 2010 0 . "FUL" 2011 0 . "FUL" 2012 0 . "FUL" 2013 0 . "FUL" 2014 0 . "FUL" 2015 0 . "FUL" 2016 0 . "FUL" 2017 0 . "FUL" 2018 0 . "FUL" 2019 0 . "FUL" 2020 0 . "GATX" 2002 0 . "GATX" 2003 0 . "GATX" 2004 0 . "GATX" 2005 0 . "GATX" 2006 0 . "GATX" 2007 0 . "GATX" 2008 0 . "GATX" 2009 0 . "GATX" 2010 0 . "GATX" 2011 0 . "GATX" 2012 0 . "GATX" 2013 0 . "GATX" 2014 0 . "GATX" 2015 0 . "GATX" 2016 0 . "GATX" 2017 0 . "GATX" 2018 0 . "GATX" 2019 0 . "GATX" 2020 0 . "AJG" 2002 0 . "AJG" 2003 0 . "AJG" 2004 0 . "AJG" 2005 0 . "AJG" 2006 0 . "AJG" 2007 0 . "AJG" 2008 0 . "AJG" 2009 0 . "AJG" 2010 0 . "AJG" 2011 0 . "AJG" 2012 0 . "AJG" 2013 0 . "AJG" 2014 0 . "AJG" 2015 0 . "AJG" 2016 0 . "AJG" 2017 0 . "AJG" 2018 0 . "AJG" 2019 0 . "AJG" 2020 0 . "TGNA" 2002 0 . "TGNA" 2003 0 . "TGNA" 2004 0 . "TGNA" 2005 0 . "TGNA" 2006 0 . "TGNA" 2007 0 . "TGNA" 2008 0 . "TGNA" 2009 0 . "TGNA" 2010 0 . "TGNA" 2011 0 . "TGNA" 2012 0 . "TGNA" 2013 0 . "TGNA" 2014 0 . "TGNA" 2015 0 . "TGNA" 2016 0 . "TGNA" 2017 0 . "TGNA" 2018 0 . "TGNA" 2019 0 . "TGNA" 2020 0 . "GPS" 2002 0 . "GPS" 2003 0 . "GPS" 2004 0 . "GPS" 2005 0 . "GPS" 2006 0 . "GPS" 2007 0 . "GPS" 2008 0 . "GPS" 2009 0 . "GPS" 2010 0 . "GPS" 2011 0 . "GPS" 2012 0 . "GPS" 2013 0 . "GPS" 2014 0 . "GPS" 2015 0 . "GPS" 2016 0 . "GPS" 2017 0 . "GPS" 2018 0 . "GPS" 2019 0 . "GPS" 2020 0 . "AJRD" 2002 0 . "AJRD" 2003 0 . "AJRD" 2004 0 . "AJRD" 2005 0 . "AJRD" 2006 0 . "AJRD" 2007 0 . "AJRD" 2008 0 . "AJRD" 2009 0 . "AJRD" 2010 0 . "AJRD" 2011 0 . "AJRD" 2012 0 . "AJRD" 2013 0 . "AJRD" 2014 0 . "AJRD" 2015 0 . "AJRD" 2016 0 . "AJRD" 2017 0 . "AJRD" 2018 0 . "AJRD" 2019 0 . "AJRD" 2020 0 . "GD" 2002 0 . "GD" 2003 0 . "GD" 2004 0 . "GD" 2005 0 . "GD" 2006 0 . "GD" 2007 0 . "GD" 2008 0 . "GD" 2009 0 . "GD" 2010 0 . "GD" 2011 0 . "GD" 2012 0 . "GD" 2013 0 . "GD" 2014 0 . "GD" 2015 0 . "GD" 2016 0 . "GD" 2017 0 . "GD" 2018 0 . "GD" 2019 0 . "GD" 2020 0 . "GE" 2002 0 . "GE" 2003 0 . "GE" 2004 0 . "GE" 2005 0 . "GE" 2006 0 . "GE" 2007 0 . "GE" 2008 0 . "GE" 2009 0 . "GE" 2010 0 . "GE" 2011 0 . "GE" 2012 0 . "GE" 2013 0 . "GE" 2014 0 . "GE" 2015 0 . "GE" 2016 0 . "GE" 2017 0 . "GE" 2018 0 . "GE" 2019 0 . "GE" 2020 0 . "GIS" 2002 0 . "GIS" 2003 0 . "GIS" 2004 0 . "GIS" 2005 0 . "GIS" 2006 0 . "GIS" 2007 0 . "GIS" 2008 0 . "GIS" 2009 0 . "GIS" 2010 0 . "GIS" 2011 0 . "GIS" 2012 0 . "GIS" 2013 0 . "GIS" 2014 0 . "GIS" 2015 0 . "GIS" 2016 0 . "GIS" 2017 0 . "GIS" 2018 0 . "GIS" 2019 0 . "GIS" 2020 0 . "GM" 2002 0 . "GM" 2003 0 . "GM" 2004 0 . "GM" 2005 0 . "GM" 2006 0 . "GM" 2007 0 . "GM" 2008 0 . "GM" 2009 0 . "GM" 2010 0 . "GM" 2011 0 . "GM" 2012 0 . "GM" 2013 0 . "GM" 2014 0 . "GM" 2015 0 . "GM" 2016 0 . "GM" 2017 0 . "GM" 2018 0 . "GM" 2019 0 . "GM" 2020 0 . "SPXC" 2002 0 . "SPXC" 2003 0 . "SPXC" 2004 0 . "SPXC" 2005 0 . "SPXC" 2006 0 . "SPXC" 2007 0 . "SPXC" 2008 0 . "SPXC" 2009 0 . "SPXC" 2010 0 . "SPXC" 2011 0 . "SPXC" 2012 0 . "SPXC" 2013 0 . "SPXC" 2014 0 . "SPXC" 2015 0 . "SPXC" 2016 0 . "SPXC" 2017 0 . "SPXC" 2018 0 . "SPXC" 2019 0 . "SPXC" 2020 0 . "GCO" 2002 0 . "GCO" 2003 0 . "GCO" 2004 0 . "GCO" 2005 0 . "GCO" 2006 0 . "GCO" 2007 0 . "GCO" 2008 0 . "GCO" 2009 0 . "GCO" 2010 0 . "GCO" 2011 0 . "GCO" 2012 0 . "GCO" 2013 0 . "GCO" 2014 0 . "GCO" 2015 0 . "GCO" 2016 0 . "GCO" 2017 0 . "GCO" 2018 0 . "GCO" 2019 0 . "GCO" 2020 0 . "GNTX" 2002 1 2006 "GNTX" 2003 1 2006 "GNTX" 2004 1 2006 "GNTX" 2005 1 2006 "GNTX" 2006 1 2006 "GNTX" 2007 1 2006 "GNTX" 2008 1 2006 "GNTX" 2009 1 2006 "GNTX" 2010 1 2006 "GNTX" 2011 1 2006 "GNTX" 2012 1 2006 "GNTX" 2013 1 2006 "GNTX" 2014 1 2006 "GNTX" 2015 1 2006 "GNTX" 2016 1 2006 "GNTX" 2017 1 2006 "GNTX" 2018 1 2006 "GNTX" 2019 1 2006 "GNTX" 2020 1 2006 end
0 Response to How to do a Propensity Score Matching and a Parallel Trend Test for a Staggered Difference in Difference Design
Post a Comment