0

I am quite new to programming and I am trying to perform an event study on m&a announcement returns. My data(DF1) consists of 186 companies that participated in a m&a. These companies are the column names 2:186 with their daily returns in those columns. The first column is the date. the other dataset(DF2) consists of the companies and the date on which the m&a was announced for that company.

So there are 186 companies with different event dates. I have tried programming it in a for loop like the code below:

for (i in Event$event_dates[1:195]) {
  firms <- Event$acquiror_name[Event$event_dates==i]
  hh2[[i]] <- evReturn(y= Returns, firm = firms, event.date = i, y.date = "date",
                       index = "sp500", event.win = 1, est.win = 199, digits = 4)
}

This gives me the abnormal return of the companies at the announcement date. However, I can not retrieve the aggregated cumulative abnormal return and its p-, or t-value. I think it needs a second for loop but i don't know how to program it.

syb
  • 1
  • The description seems reasonable, but it would be much simpler if you provided sample data by posting the output from `dput(DF1[1:10,1:10])` for each of the frames needed, *ensuring* that companies in one are found in the other. Also, please include your expected output given that sample data. See https://stackoverflow.com/q/5963269/3358272, [mcve], and https://stackoverflow.com/tags/r/info for good discussions on "reproducible". Thanks! – r2evans Jan 21 '22 at 15:17

0 Answers0