Hello Forum,
I am trying to create a dummy variable ( multiple ) that takes the value of 1 if the firm has completed five or more acquisitions within three years of the first acquisition. I have tried the below code but it seems like I didn't do it correctly. I am sharing my data as well can you help me how to create this dummy variable? In the data, SDCdealno is unique for each deal and Acquiror Datastream is unique for each firm.
Thank You.
I am trying to create a dummy variable ( multiple ) that takes the value of 1 if the firm has completed five or more acquisitions within three years of the first acquisition. I have tried the below code but it seems like I didn't do it correctly. I am sharing my data as well can you help me how to create this dummy variable? In the data, SDCdealno is unique for each deal and Acquiror Datastream is unique for each firm.
Thank You.
Code:
egen Firmid= group(AcquirorDatastream) gen Year= year(DateAnnounced) egen Yearid= group(Year) sort Firmid DateAnnounced gen long obs_no = _n local three_years = 365.25*3 rangestat (count) obs_no, by(AcquirorDatastream) interval(DateAnnounced, 0, `three_years') by AcquirorDatastream, sort: egen keeper = max(obs_no_count >= 5) gen Multiple=( AcquirorDatastream[_n-3]== AcquirorDatastream ) & Year[_n-3]>Year-5
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int DateAnnounced str6 AcquirorDatastream str10 SDCDealNo 17636 "130062" "1924997020" 18063 "130062" "2082259020" 19751 "130062" "2593089020" 20996 "130062" "3119302020" 17603 "130086" "1960259020" 18886 "130086" "2345790020" 18886 "130086" "2345788020" 21929 "130086" "3502739020" 20726 "130088" "3012582020" 17633 "130298" "1968943020" 19919 "130298" "2655953020" 20689 "130298" "3010025040" 21532 "130298" "3240426040" 18017 "130375" "2069880020" 20674 "130485" "2993116020" 20999 "130485" "3121259020" 20120 "130502" "2728784020" 20485 "130502" "2938996020" 21063 "130502" "3146004020" 21181 "130502" "3200683020" 21277 "130556" "3230754020" 18434 "130720" "2194164020" 18904 "130775" "2352405020" 20606 "130841" "2966732020" 21684 "130841" "3397826020" 19262 "130859" "2454300020" 20013 "130859" "2686750020" 20709 "130859" "3006379020" 21027 "130859" "3152961020" 21879 "130859" "3482995020" 18656 "131745" "2285871020" 19120 "131745" "2412064020" 20207 "131745" "2747970020" 20669 "131745" "2990661020" 21153 "131745" "3184217020" 21354 "131745" "3257258020" 21502 "131745" "3309280020" 22264 "131745" "3676141020" 20587 "131771" "2964624040" 21451 "131771" "3291789020" 18326 "131844" "2162135020" 18455 "131844" "2202088020" 19289 "131844" "2462221020" 19701 "131844" "2590117020" 19950 "131844" "2665213020" 20030 "131844" "2691896020" 21063 "131844" "3149391020" 20361 "131880" "2807508020" 21783 "131880" "3480757020" 17371 "132050" "1891110020" 18819 "132050" "2327919020" 19570 "132050" "2551509020" 19886 "132050" "2646129020" 21459 "132050" "3317334040" 21076 "132125" "3157036020" 21837 "132125" "3468244020" 21657 "132736" "3383166020" 20248 "132800" "2761411020" 20879 "132800" "3075445040" 21216 "132800" "3208848020" 19275 "133234" "2458094020" 19683 "133234" "2586586020" 19827 "133234" "2628559020" 20894 "133234" "3082008020" 21649 "133234" "3381936020" 20395 "133324" "2817066020" 20495 "133324" "2920211020" 20667 "133324" "2989654020" 20747 "133324" "3020251020" 20909 "133324" "3087786020" 21467 "133324" "3297366020" 17700 "133891" "1987730020" 18822 "133891" "2328909020" 19395 "133891" "2493821020" 18437 "134057" "2195660020" 19242 "134057" "2447925020" 19709 "134057" "2594208020" 21181 "134057" "3206932020" 21661 "134057" "3385269040" 21684 "134057" "3393935020" 17540 "134058" "1942387040" 17576 "134058" "1952903040" 17584 "134058" "1954744020" 17639 "134058" "1970197020" 17650 "134058" "1973089020" 17973 "134058" "2057835020" 21370 "134499" "3264203020" 21040 "134507" "3136606020" 21978 "13466Q" "3522125040" 19220 "13471D" "2442379020" 19747 "13471D" "2604312020" 19981 "13471D" "2674984040" 20172 "13471D" "2737295040" 20437 "13471D" "2847189020" 21034 "13471D" "3134516020" 21398 "13471D" "3273424020" 21697 "13471D" "3397174020" 21032 "13473U" "3645927020" 21759 "13473U" "3434769020" 22215 "13473U" "3652914020" end format %td DateAnnounced
Comment