普林斯顿大学的event study源代码中,红色这个部分怎么理解呢???
这个案例中应该是用id=group(company_id)还是 id = group(group_id) ;应该怎么样理解呢??谢谢
set more off
gen predicted_return=.
egen id=group(company_id)
/* for multiple event dates, use: egen id = group(group_id) */
forvalues i=1(1)N{ /*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
}
sort id date
gen abnormal_return=ret-predicted_return if event_window==1
by id: egen cumulative_abnormal_return = sum(abnormal_return)


雷达卡





京公网安备 11010802022788号







