I have survey data on individual firms from 2008-2017. I want to test how a reform that happened in 2013 that affected all individuals influenced their earnings. My testing hypothesis is that the effect is going to be dependent on the level of pre-reform competition (measured by number of rival firms in 3km radius). So my treatment variable is "dd3 = reform=(years>=2014) * prereform_comp".
From response received on my one previous post (https://www.statalist.org/forums/for...t-observations), on a related issue, I note Stata comand xtdidregress does not yet support graphical diagnostics for parallel trends assumption for continuous treatment. And the ways to do it are generally in the spirit when treatment variable is a dummy instead of continuous.
1. My main model accounts for individual and time fixed effects and takes the form of:
reghdfe `outcome' dd3 $controls, absorb(id years) vce(cluster id)
2. In my analysis, I also run model specification to analyse how the impact would be different for individuals facing different levels (quartiles) of pre-reform competition. This is modelled as below:
reghdfe `outcome' dd3 $controls, absorb(id years) vce(cluster id)
where dd3 now is: dd3 = reform=(years>=2014) * quartile_3km*prereform_comp". Quartile1 is my omitted category here.
Now I would like to test if parallel trends assumption hold in my analysis.
I am attaching a sample of observations that I have. Any help to test diagnostics for parallel trends assumption would be most appreciated.
Thanks.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long xwaveid float(years lannualY dd3) byte quartile_3km float hrs 1100002 2008 11.686398 0 1 32 1100002 2009 11.997396 0 1 36 1100002 2010 11.85281 0 1 34 1100002 2011 12.017887 0 1 36 1100002 2012 11.614816 0 1 34 1100002 2013 11.682918 0 1 30 1100005 2008 12.74331 0 1 36 1100005 2010 12.758693 0 1 32 1100005 2011 12.752957 0 1 41 1100008 2008 12.59228 0 2 55 1100008 2009 12.577435 0 2 50 1100008 2010 12.639094 0 2 50 1100008 2011 12.41624 0 2 48 1100008 2012 12.679445 0 2 47 1100008 2013 12.38578 0 2 48 1100008 2014 12.518613 39 2 40 1100008 2015 12.47567 39 2 31 1100010 2011 12.26209 0 2 35 1100010 2014 12.788903 41 2 35 1100010 2016 11.567077 41 2 30 1100011 2008 12.194057 0 1 38 1100011 2009 12.345364 0 1 32 1100011 2010 12.163589 0 1 35 1100011 2011 11.619886 0 1 25 1100012 2008 11.00119 0 4 12 1100012 2009 11.150636 0 4 18 1100012 2011 11.163477 0 4 20 1100012 2012 11.502678 0 4 32 1100012 2013 12.120378 0 4 30 1100012 2014 11.673064 124.4 4 35 1100012 2015 11.87079 124.4 4 35 1100012 2016 12.270066 124.4 4 30 1100012 2017 11.98143 124.4 4 33 1100013 2008 12.57995 0 4 33 1100013 2009 13.01717 0 4 41 1100013 2010 12.785512 0 4 46 1100013 2013 13.03439 0 4 50 1100014 2008 10.430075 0 3 21 1100014 2009 10.281137 0 3 11 1100014 2010 9.88554 0 3 20 1100021 2008 11.9355 0 3 30 1100021 2009 11.795596 0 3 36 1100021 2010 11.405168 0 3 25 1100021 2011 11.704503 0 3 29 1100021 2012 11.44317 0 3 30 1100021 2013 11.83622 0 3 32 1100028 2008 11.156384 0 4 16 1100028 2009 11.494257 0 4 15 1100028 2010 11.583652 0 4 18 1100028 2011 11.855001 0 4 18 1100028 2012 11.44317 0 4 18 1100028 2013 11.478524 0 4 18 1100028 2014 12.241905 137.2 4 19 1100028 2015 12.293347 137.2 4 19 1100028 2016 11.781213 137.2 4 21 1100028 2017 12.045792 137.2 4 23 1100030 2009 11.52969 0 2 17 1100030 2010 11.65244 0 2 26 1100030 2011 11.677086 0 2 29 1100030 2012 11.73967 0 2 28 1100030 2013 11.83622 0 2 32 1100030 2015 11.804792 27.2 2 31 1100030 2016 11.81769 27.2 2 27 1100030 2017 11.259967 27.2 2 33 1100031 2009 10.720964 0 1 18 1100031 2011 10.086025 0 1 14 1100031 2012 10.327307 0 1 17 1100032 2009 13.217962 0 2 54 1100032 2010 12.98266 0 2 60 1100032 2011 12.950105 0 2 50 1100032 2012 13.058546 0 2 50 1100032 2013 12.908464 0 2 50 1100032 2014 12.89323 42.2 2 38 1100032 2015 12.62509 42.2 2 48 1100032 2016 12.770346 42.2 2 50 1100032 2017 12.844865 42.2 2 45 1100035 2008 12.320346 0 1 42 1100035 2012 11.860375 0 1 46 1100036 2008 12.09435 0 2 40.5 1100036 2009 11.76374 0 2 30 1100036 2010 11.421727 0 2 30 1100036 2011 11.47933 0 2 30 1100036 2013 11.419016 0 2 26 1100036 2014 11.97863 29.8 2 24 1100036 2016 11.76276 29.8 2 24 1100036 2017 10.661768 29.8 2 27 1100037 2012 12.41897 0 3 43 1100037 2015 12.825226 55.2 3 40 1100037 2016 13.234243 55.2 3 40 1100037 2017 12.799034 55.2 3 42 1100040 2008 11.200836 0 4 17 1100040 2009 11.35276 0 4 17 1100040 2010 11.768997 0 4 21 1100040 2012 12.163022 0 4 25 1100040 2013 11.92321 0 4 28 1100040 2014 12.321003 226.8 4 30 1100040 2015 12.18087 226.8 4 30 1100040 2016 12.34998 226.8 4 27 1100040 2017 12.23112 226.8 4 26.5 1100043 2008 11.088202 0 2 36 end label values quartile_3km quartile_3km label def quartile_3km 1 "Quartile 1 of competition", modify label def quartile_3km 2 "Quartile 2 of competition", modify label def quartile_3km 3 "Quartile 3 of competition", modify label def quartile_3km 4 "Quartile 4 of competition", modify
0 Response to Parallel trends assumption with continuous treatment variable - DiD
Post a Comment