Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long company_id int year float(cash2 asset2 roa2) int event_year byte post 35 2007 . . . . . 35 2008 . . . . . 35 2009 . . . . . 35 2010 . . . . . 35 2011 . . . . . 35 2012 . . . . . 35 2013 . . . . . 35 2014 .1127009 21.90875 .0570275 2014 0 35 2015 .0645279 22.20465 .0548749 2014 1 35 2016 .0473218 22.51477 .032463 2014 1 35 2017 .0453601 22.81886 .0356166 2014 1 37 2007 . . . . . 37 2008 . . . . . 37 2009 . . . . . 37 2010 . . . . . 37 2011 . . . . . 37 2012 . . . . . 37 2013 . . . . . 37 2014 . . . . . 37 2015 .2241614 22.24493 -.1642308 2011 1 37 2016 .2352649 22.19659 .2031146 2011 1 37 2017 .3559973 21.78238 .0031499 2011 1 38 2007 . . . . . 38 2008 . . . . . 38 2009 . . . . . 38 2010 . . . . . 38 2011 .0292621 20.26197 .0088071 2011 0 38 2012 .0302361 20.22923 .0187552 2011 1 38 2013 .0280254 20.33895 .0174681 2011 1 38 2014 .0518462 20.34243 -.0743601 2011 1 38 2015 .1417207 20.4286 .0267013 2011 1 38 2016 . . . . . 38 2017 . . . . . 39 2007 . . . . . 39 2008 . . . . . 39 2009 . . . . . 39 2010 . . . . . 39 2011 . . . . . 39 2012 .0828916 24.86628 .041901 2011 1 39 2013 .0657115 25.00831 .0464264 2011 1 39 2014 .0417811 25.01401 .0375714 2011 1 39 2015 .0420292 25.01401 .0275726 2011 1 39 2016 .0382863 25.01401 .0064241 2011 1 39 2017 .0280802 25.01401 .0319415 2011 1 end
- The purpose is to keep `company_id' with both pre- and post-event data.
- The event occurred in `event_year' (suppose that the effect of the policy begins in the next year).
- Taking company_id=35 for example, the pre period is year=2014 and the post period is year=2015 (of course, including other 2016, ... years), both with data on cash2, asset2, and roa2, and so on. Thus, we want to keep this company_id for later analysis.
- Taking another company_id=37 for instance, the pre period is year=2011 and the post period is year=2012 (of course, including other 2013, ... years). There is no data (all missing data) in the pre period. Thus, we want to drop this company_id.
- Any suggestion is appreciated.
0 Response to keep data with both pre- and post-event data?
Post a Comment