Dear statalist,
I have one set of data about some deals, for each deal, there is announcement date, end date, deal number, and symbol (to identify which firm the deal belongs to). A firm could have multiple deals in a year, and there are different deal numbers to distinguish them. I have another set of data, which lists firms' declare date, there is only one declare date for each firm in a year. In this data, variables include year, symbol, and declare date.
The period between announcement date and end date is the deal period, and I want to identify all the declare dates that fall within the deal period for each deal of a firm. I wonder how this can be achieved? Thanks a lot for any advice!
Data for deals and dates:
Data for firms' declare dates:
I have one set of data about some deals, for each deal, there is announcement date, end date, deal number, and symbol (to identify which firm the deal belongs to). A firm could have multiple deals in a year, and there are different deal numbers to distinguish them. I have another set of data, which lists firms' declare date, there is only one declare date for each firm in a year. In this data, variables include year, symbol, and declare date.
The period between announcement date and end date is the deal period, and I want to identify all the declare dates that fall within the deal period for each deal of a firm. I wonder how this can be achieved? Thanks a lot for any advice!
Data for deals and dates:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long DealNumber int Announceddate float end_date long Symbol 1000012032 17493 18341 38 1943185129 21986 22046 42 1939082254 21832 21966 42 1943173585 21967 21984 42 1943084825 21402 21405 46 1907166257 20637 20638 46 1603014662 17960 18690 46 1600001163 17546 18278 46 1943042385 21355 21356 46 1943042389 21340 21341 46 1943089014 21160 21182 46 1943089011 20950 20961 46 1943124865 21778 21833 48 1907137044 20473 21286 65 1633058893 18926 18991 69 1907068614 19772 19773 69 1907000052 19536 19900 69 1633062049 18993 19023 69 end format %td Announceddate format %td end_date
Code:
Symbol declaredate year 38 24apr2010 2010 38 27apr2011 2011 38 20apr2012 2012 38 24apr2013 2013 38 25apr2014 2014 38 28apr2015 2015 38 21apr2016 2016 38 15apr2017 2017 38 21apr2018 2018 38 30apr2019 2019 38 23apr2020 2020 42 10apr2010 2010 42 13apr2011 2011 42 12apr2012 2012 42 13apr2013 2013 42 28mar2014 2014 42 21mar2015 2015 42 29mar2016 2016 42 29apr2017 2017 42 27apr2018 2018 42 13apr2019 2019 42 28apr2020 2020 46 02mar2010 2010 46 16apr2011 2011 46 21apr2012 2012 46 20apr2013 2013 46 28mar2014 2014 46 04apr2015 2015 46 31mar2016 2016 46 25apr2017 2017 46 28apr2018 2018 46 17apr2019 2019 46 29apr2020 2020 65 23mar2010 2010 65 29mar2011 2011 65 13mar2012 2012 65 26mar2013 2013 65 31mar2014 2014 65 24mar2015 2015 65 31mar2016 2016 65 29apr2017 2017 65 28mar2018 2018 65 02apr2019 2019 65 20apr2020 2020 69 22apr2010 2010 69 04mar2011 2011 69 17mar2012 2012 69 09mar2013 2013 69 13mar2014 2014 69 21mar2015 2015 69 23apr2016 2016 69 08apr2017 2017 69 27apr2018 2018 69 30mar2019 2019 69 28apr2020 2020

Comment