Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long stkcd int year byte new 2 2015 0 2 2016 0 2 2017 1 2 2018 0 2 2019 0 4 2015 0 4 2016 0 4 2017 0 5 2015 0 5 2016 1 5 2017 0 5 2018 0 6 2015 0 6 2016 0 6 2017 0 6 2018 0 6 2019 0 7 2015 0 7 2016 1 8 2015 0 8 2016 0 8 2017 0 8 2018 0 8 2019 0 9 2015 0 9 2016 0 9 2017 0 9 2018 0 10 2015 0 10 2016 0 10 2017 0 10 2018 1 end
Code:
rangestat (max) new, interval(year 1 .) by(stkcd) drop if new_max == 1 drop new_max
0 Response to drop observations before new==1
Post a Comment