Hello,
I am trying to calculate a variety of CAARs for my dataset. I already have calculated the average abnormal returns in the following manner:
bysort acquirer_nationb dif : egen AARAN=mean(abnormal_return)
bysort target_nationb dif : egen AARTN=mean(abnormal_return)
bysort acquirer_sectorb dif : egen AARAS=mean(abnormal_return)
bysort target_sectorb dif : egen AARTS=mean(abnormal_return)
bysort acquirer_industryb dif : egen AARAI=mean(abnormal_return)
bysort target_industryb dif : egen AARTI=mean(abnormal_return)
bysort domestic dif : egen AARD=mean(abnormal_return)
bysort same_sectorb dif : egen AARSS=mean(abnormal_return)
bysort same_industryb dif : egen AARSI=mean(abnormal_return)
bysort transaction_directionb dif : egen AARTD=mean(abnormal_return)
bysort volume_quartile dif : egen AARVQ=mean(abnormal_return)
bysort payment_methodb dif : egen AARPM=mean(abnormal_return)
So, here I calculated the AAR for each observation depending on different groups (calculated the average for all from country a or b, calculated the average for all with payment type or b etc)
Now I have the individual AAR for each date and want to add them up in order to obtain the CAAR.
For example, in order to obtain the CAAR for the acquirer nation I tried it with . bysort acquirer_nationb dif : egen caarsan = sum(AARAN)
. bysort acquirer_nationb (dif) : egen caarsani = sum(AARAN).
Now, lets say for example I have 5 observations for acquiring country a. In my database each observation therefore has the same value for AAR on day t. Now if I type this code, I have the problem that caarsan adds the average 5 times for each (since I have 5 observations for the country) while the caarsani code gives me for each t the sum of the averages.
However, I really want a combination of both. I want the sum of all averages but every average only counted once. Can anybody provide me with some help on how to do that? Im attaching a picture
Related Posts with Calculating CAAR (Event Study)
Error downloading updates - error extracting contentsHi all, I tried to update Stata (update all), and Stata issued an error message. error extracting …
Filling missing values on variables only appearing every four years in the panelHi Statalist. I have a couple of variables that only appear in waves 4, 7, 10, 14, 18 (of a panel d…
Addplot ) required error r(100);Hello world I'm working on a code to make a graph, and it keeps getting in trouble. It`s a panel d…
problem with parsing numeric and string arguments in ado filehello, I want to write an ado file in which I have one numeric argument, one string argument, and on…
Testing for differences between groupsHello! I was tasked with proving how having the first two children of the same sex predicts whether…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating CAAR (Event Study)
Post a Comment