Hello,
i'm trying to generate cumulative sum of deal values (£ mn.) for acquisitions of target companies in an interval of 3 years prior to any acquisition announcement. I've tried using a similar code as given in Stata Journal (2007) 7: Events in intervals, but can't get desired result. Basically, i'm trying to see the cumulative sum of the amounts paid for prior acquisitions during a span of 3 years of any acquisition by each acquiring company in the sample period. The code i've used to generate this sum (i'm not sure how to generate cumulative sum) as yr3_cum_dealval in an interval of 3 years:
gen event_date = .
quietly forval i = 1/`= _N' {
sum (deal_value_mn) if lspdno == lspdno[`i'] & inrange(event_date[`i'] – event_date, 1, 1098)
replace yr3_cum_dealval = r(sum) in `i'
}
Here, deal_value_mn is theamount paid in £ mn. for each acquisition, lspdno is the unique id for each acquiring company, event_date date of announcement of each deal/acquisition, 1098 = 366*3 (3 years interval).
I don't understand in the column yr3_cum_dealval, why i always get '0' as starting deal value in the span of 3 years, when it should rather be the actual amount paid in the first acquisition, the sum of 1st deal amount and 2nd deal amount for the second acquisition, likewise the sum of first two amounts paid plus that paid for the 3rd in case of cumulative deal value for third acquisition (provided the first two acquisitions took place within 3 years of the third deal) and so on.
Also, when there were 2 acquisitions announced on the same date, the cumulative deal value for each of these dates should be different (i get same yr3_cum_dealval for 2 same date acquisitions), the 1st same date should have the sum of amounts paid for the prior 3 year deals as well as current deal amount, whereas the 2nd same date should have the first same event_date amount paid included in the cumulative sum with prior 3 year amounts, as well as the amount corresponding to the current acquisition.
I'm providing the dropbox link for a snapshot of my data for just 1 company doing many acquisitions from year 1994 until 2006, where the column with name yr3_cum_dealval shows what i got usingthe above code, while Correct_yr3_cum_dealval shows what i need to get. Here it is: https://dl.dropboxusercontent.com/u/...alue_ranks.dta
Can anybody please help me to understand where i'm going wrong?Thanks,
Suparna Ray
i'm trying to generate cumulative sum of deal values (£ mn.) for acquisitions of target companies in an interval of 3 years prior to any acquisition announcement. I've tried using a similar code as given in Stata Journal (2007) 7: Events in intervals, but can't get desired result. Basically, i'm trying to see the cumulative sum of the amounts paid for prior acquisitions during a span of 3 years of any acquisition by each acquiring company in the sample period. The code i've used to generate this sum (i'm not sure how to generate cumulative sum) as yr3_cum_dealval in an interval of 3 years:
gen event_date = .
quietly forval i = 1/`= _N' {
sum (deal_value_mn) if lspdno == lspdno[`i'] & inrange(event_date[`i'] – event_date, 1, 1098)
replace yr3_cum_dealval = r(sum) in `i'
}
Here, deal_value_mn is theamount paid in £ mn. for each acquisition, lspdno is the unique id for each acquiring company, event_date date of announcement of each deal/acquisition, 1098 = 366*3 (3 years interval).
I don't understand in the column yr3_cum_dealval, why i always get '0' as starting deal value in the span of 3 years, when it should rather be the actual amount paid in the first acquisition, the sum of 1st deal amount and 2nd deal amount for the second acquisition, likewise the sum of first two amounts paid plus that paid for the 3rd in case of cumulative deal value for third acquisition (provided the first two acquisitions took place within 3 years of the third deal) and so on.
Also, when there were 2 acquisitions announced on the same date, the cumulative deal value for each of these dates should be different (i get same yr3_cum_dealval for 2 same date acquisitions), the 1st same date should have the sum of amounts paid for the prior 3 year deals as well as current deal amount, whereas the 2nd same date should have the first same event_date amount paid included in the cumulative sum with prior 3 year amounts, as well as the amount corresponding to the current acquisition.
I'm providing the dropbox link for a snapshot of my data for just 1 company doing many acquisitions from year 1994 until 2006, where the column with name yr3_cum_dealval shows what i got usingthe above code, while Correct_yr3_cum_dealval shows what i need to get. Here it is: https://dl.dropboxusercontent.com/u/...alue_ranks.dta
Can anybody please help me to understand where i'm going wrong?Thanks,
Suparna Ray
Comment