Hi everyone,
I've gone through the Princeton event study stata coding, everything run through (I haven't coded the test bit), but I found that my dataset does not contain the predicted return and the accumulative return. What went wrong?
sum predicted_ret cumulative_abnormal_return
Variable | obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
predicted_~n | 0
cumulative~n | 8, 214 0 0 0 0
My codes:
gen predicted_return=.
egen id=group(com_id)
forvalues i=1(1)144 { /*note: replace N with the highest value of id */
l id com\_id if id==\`i' & dif==0 reg ret mkt\_ret if id==\`i' & estimation\_window==1 predict p if id==\`i' replace predicted\_return = p if id==\`i' & event\_window3==1 drop p
}
*calculate abnormal return
sort id date
gen abnormal_return=ret-predicted_return if event_window3==1
by id: egen cumulative_abnormal_return = total(abnormal_return)
Related Posts with Princeton's Event study did not generate the predicted return
appending a string and time variablesTwo of the variables in my dataset needs to be appended into a new variable. The first of represents…
mixed models xtreg xtmixedHi All, I have a question about xtreg and xtmixed. If I enter the following command I get this res…
How to drop duplicate ID observation series with different variable valuesHi all, I hava an panel dataset for firms and stock returns between 2005 and 2015. However, for som…
Different markers with rcapsymHi, I would like to have 2 different markers for the starting points and the end points. So for exa…
Regarding the question of the spmatrix import comandi do a spmatrix import, while it Array i modify my matrix from the command of spmatrix export, so i…
Subscribe to:
Post Comments (Atom)
0 Response to Princeton's Event study did not generate the predicted return
Post a Comment