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)
Why no results for "estat abond" when running an xtabond mondel with "vce(gmm)"?Hi all, I'm estimating a model with the xtabond command, and when I run the post-estimation command…
Coefplot issueHi all, I have a quick question. My code is below. When I do this code without the "at(vertical)" p…
collapse all Variables in StataHi I have number of variables in Stata and I want to collapse in Stata using mean statistics. coll…
A problem in Maximum Likelihood estimation (MLE) "‘lnfj’ invalid name"..Hello everyone, I am learning the MLE model and practicing through the book examples using Stata12.…
Change in the default bandwidth of -lpoly- from Stata 15/16 to 17Hello Stata and Statalisters, The default bandwidth of -lpoly- appears to have changed from Stata 1…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating CAAR (Event Study)
Post a Comment