Hello,
I have conducted an event study using an OLS market model to determine whether there is a variation in stock prices when a certain event ha been announced. The sample consists 37 firms from different countries across different industries as you can find below the STATA codes. However, the model to test the variation in return for overall firms has a R squared value of 0,000 as shown in attachment.

I think something went wrong because the model to test the variation in return for each firm do have a higher R squared value. I will be very thankful if someone can help me on this matter.
STATA codes used to conduct this event study are shown as follows:
*1) Cleaning the data and Calculating the Event and Estimation Windows
*For number of trading days:
sort company_id date
by company_id: gen datenum=_n
by company_id: gen target=datenum if date==event_date
egen td=min(target), by(company_id)
drop target
gen dif=datenum-td
*Certain events have confounding events within the event window, therefore, these observations should not be taken into account
drop if company_id==6
drop if company_id==19
drop if company_id==20
drop if company_id==23
drop if company_id==32
drop if company_id==40
by company_id: gen event_window=1 if dif>=-1 & dif<=1
egen count_event_obs=count(event_window), by(company_id)
by company_id: gen estimation_window=1 if dif>=-301 & dif<-1
egen count_est_obs=count(estimation_window), by(company_id)
replace event_window=0 if event_window==.
replace estimation_window=0 if estimation_window==.
tab company_id if count_event_obs<3
tab company_id if count_est_obs<30
drop if count_event_obs < 3
drop if count_est_obs < 30
drop count_event_obs
drop count_est_obs
*2)Estimating Normal Performance
gen predicted_return=.
egen id=group(company_id)
/* for multiple event dates, use: egen id = group(group_id) */
forvalues i=1(1)37 { /*note: replace N with the highest value of id */
l id company_id if id==`i' & dif==0
reg ret market_return if id==`i' & estimation_window==1
predict p if id==`i'
replace predicted_return = p if id==`i' & event_window==1
drop p
}
*3)Abnormal and Cumulative Abnormal Returns
sort id date
gen abnormal_return=ret-predicted_return if event_window==1
by id: egen cumulative_abnormal_return = sum(abnormal_return)
*4) Testing for Significance
sort id date
by id: egen ar_sd = sd(abnormal_return)
gen test =(1/sqrt(3)) * ( cumulative_abnormal_return /ar_sd)
list company_id cumulative_abnormal_return test if dif==0
*5) Testing Across All Events
reg cumulative_abnormal_return if dif==0, robust
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input int date byte company_id double(ret market_return) int event_date byte _merge_eventdate_stockreturn int SIC byte _merge
19968 1 -.0189699224788216 -.0004065831108909955 20720 3 124 3
19891 1 -.0022607727181933185 -.003122270336573342 20720 3 124 3
19851 1 -.008234394585821502 -.0025477006543374397 20720 3 124 3
20458 1 -.02445961319681455 -.011681172698121816 20720 3 124 3
20676 1 -.00929549902152648 -.005117088944955791 20720 3 124 3
21182 1 0 0 20720 3 124 3
20740 1 -.009230769230769268 .00003624304586554158 20720 3 124 3
20919 1 -.012436844150796746 .0026391433710435085 20720 3 124 3
19960 1 -.0008044150896778804 .0003018037210623168 20720 3 124 3
19849 1 -.013009007984996332 -.00798140113863098 20720 3 124 3
19834 1 -.0023622135710716333 .004095650896268032 20720 3 124 3
20017 1 .015407103946425428 .011444705882352975 20720 3 124 3
20614 1 -.04130545639979596 -.00842314341413162 20720 3 124 3
19926 1 .012204983701678173 .005963136971449223 20720 3 124 3
19869 1 -.0005250588574041566 .00007285443683530266 20720 3 124 3
20325 1 .02570694087403605 .006823748979353679 20720 3 124 3
21241 1 .008101101749837978 .0021477034216820126 20720 3 124 3
20774 1 .003336113427856476 .0017223498036890272 20720 3 124 3
20228 1 .014573213046495425 .008835055219095184 20720 3 124 3
21235 1 -.04760383386581476 .00028119624189490173 20720 3 124 3
20215 1 -.018500434573966426 -.0016652494331066726 20720 3 124 3
20367 1 .01591289782244567 .005654933641084754 20720 3 124 3
20852 1 -.031065088757396445 -.004195632329190302 20720 3 124 3
20270 1 .01313320825515953 .01487468216491094 20720 3 124 3
21061 1 .01595547309833023 .007412187380096968 20720 3 124 3
19898 1 -.006856532343988812 -.005226126941330757 20720 3 124 3
I have conducted an event study using an OLS market model to determine whether there is a variation in stock prices when a certain event ha been announced. The sample consists 37 firms from different countries across different industries as you can find below the STATA codes. However, the model to test the variation in return for overall firms has a R squared value of 0,000 as shown in attachment.
I think something went wrong because the model to test the variation in return for each firm do have a higher R squared value. I will be very thankful if someone can help me on this matter.
STATA codes used to conduct this event study are shown as follows:
*1) Cleaning the data and Calculating the Event and Estimation Windows
*For number of trading days:
sort company_id date
by company_id: gen datenum=_n
by company_id: gen target=datenum if date==event_date
egen td=min(target), by(company_id)
drop target
gen dif=datenum-td
*Certain events have confounding events within the event window, therefore, these observations should not be taken into account
drop if company_id==6
drop if company_id==19
drop if company_id==20
drop if company_id==23
drop if company_id==32
drop if company_id==40
by company_id: gen event_window=1 if dif>=-1 & dif<=1
egen count_event_obs=count(event_window), by(company_id)
by company_id: gen estimation_window=1 if dif>=-301 & dif<-1
egen count_est_obs=count(estimation_window), by(company_id)
replace event_window=0 if event_window==.
replace estimation_window=0 if estimation_window==.
tab company_id if count_event_obs<3
tab company_id if count_est_obs<30
drop if count_event_obs < 3
drop if count_est_obs < 30
drop count_event_obs
drop count_est_obs
*2)Estimating Normal Performance
gen predicted_return=.
egen id=group(company_id)
/* for multiple event dates, use: egen id = group(group_id) */
forvalues i=1(1)37 { /*note: replace N with the highest value of id */
l id company_id if id==`i' & dif==0
reg ret market_return if id==`i' & estimation_window==1
predict p if id==`i'
replace predicted_return = p if id==`i' & event_window==1
drop p
}
*3)Abnormal and Cumulative Abnormal Returns
sort id date
gen abnormal_return=ret-predicted_return if event_window==1
by id: egen cumulative_abnormal_return = sum(abnormal_return)
*4) Testing for Significance
sort id date
by id: egen ar_sd = sd(abnormal_return)
gen test =(1/sqrt(3)) * ( cumulative_abnormal_return /ar_sd)
list company_id cumulative_abnormal_return test if dif==0
*5) Testing Across All Events
reg cumulative_abnormal_return if dif==0, robust
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input int date byte company_id double(ret market_return) int event_date byte _merge_eventdate_stockreturn int SIC byte _merge
19968 1 -.0189699224788216 -.0004065831108909955 20720 3 124 3
19891 1 -.0022607727181933185 -.003122270336573342 20720 3 124 3
19851 1 -.008234394585821502 -.0025477006543374397 20720 3 124 3
20458 1 -.02445961319681455 -.011681172698121816 20720 3 124 3
20676 1 -.00929549902152648 -.005117088944955791 20720 3 124 3
21182 1 0 0 20720 3 124 3
20740 1 -.009230769230769268 .00003624304586554158 20720 3 124 3
20919 1 -.012436844150796746 .0026391433710435085 20720 3 124 3
19960 1 -.0008044150896778804 .0003018037210623168 20720 3 124 3
19849 1 -.013009007984996332 -.00798140113863098 20720 3 124 3
19834 1 -.0023622135710716333 .004095650896268032 20720 3 124 3
20017 1 .015407103946425428 .011444705882352975 20720 3 124 3
20614 1 -.04130545639979596 -.00842314341413162 20720 3 124 3
19926 1 .012204983701678173 .005963136971449223 20720 3 124 3
19869 1 -.0005250588574041566 .00007285443683530266 20720 3 124 3
20325 1 .02570694087403605 .006823748979353679 20720 3 124 3
21241 1 .008101101749837978 .0021477034216820126 20720 3 124 3
20774 1 .003336113427856476 .0017223498036890272 20720 3 124 3
20228 1 .014573213046495425 .008835055219095184 20720 3 124 3
21235 1 -.04760383386581476 .00028119624189490173 20720 3 124 3
20215 1 -.018500434573966426 -.0016652494331066726 20720 3 124 3
20367 1 .01591289782244567 .005654933641084754 20720 3 124 3
20852 1 -.031065088757396445 -.004195632329190302 20720 3 124 3
20270 1 .01313320825515953 .01487468216491094 20720 3 124 3
21061 1 .01595547309833023 .007412187380096968 20720 3 124 3
19898 1 -.006856532343988812 -.005226126941330757 20720 3 124 3
Comment