Hello,
I have data on M&A transactions for publicly listed firms (identifier gvkey_n). Thus, my dataset is on the "deal" / "transaction" level. Conditional on the focal deal (observation) of a company identified by gvkey_n, I want to calculate the number of deals of this company, i.e., the number of observations, within the next, let's say, two years. The variable dateannounced identifies the date of the deals.
Is there a way to calculate for each observation the number of subsequent observations within the next years (variable numberofdealsnext2years)? In a similar spirit, I would need to sum up the value of these deals, i.e., the values from valueoftransactionmil in a new variable (variable valueofdealsnext2years).
Guidance is much appreciated! I hope the problem is clear.
Best regards,
Pascal
I have data on M&A transactions for publicly listed firms (identifier gvkey_n). Thus, my dataset is on the "deal" / "transaction" level. Conditional on the focal deal (observation) of a company identified by gvkey_n, I want to calculate the number of deals of this company, i.e., the number of observations, within the next, let's say, two years. The variable dateannounced identifies the date of the deals.
Is there a way to calculate for each observation the number of subsequent observations within the next years (variable numberofdealsnext2years)? In a similar spirit, I would need to sum up the value of these deals, i.e., the values from valueoftransactionmil in a new variable (variable valueofdealsnext2years).
Guidance is much appreciated! I hope the problem is clear.
Best regards,
Pascal
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long gvkey_n float dateannounced double valueoftransactionmil 1004 17588 40 1004 18346 200 1004 18920 280 1013 14735 80 1013 16155 350 1013 17461 169
Comment