set more on /* this command just keeps stata from pausing after each screen of output */
gen predicted_return=.
egen id=group(group_id)
/* for multiple event dates, use: egen id = group(group_id) */
forvalues i=1(1)615 { /*note: replace N with the highest value of id */
l id group_id if id==`i' & dif==0
reg biandong market if id==`i' & estimation_window==1
predict p if id==`i'
replace predicted_return = p if id==`i' & event_window==1
drop p
}
事件研究法中的代码,请高人指点l id group_id if id==`i' & dif==0这句代码的意思