gen predicted_return=./*用于存放正常回报率的变量*/
egen id = group(code)/*重新定义公司代码为1,2,3……,便于执行循环程序*/
sum id
local N=r(max)/*记录公司数目*/
forvalues i=1(1)246{
l id code if id==`i' & dif==0
qui reg ret market_return if id==`i' & estimation_windows==1
predict pr if id==`i'
replace predicted_return = pr if id==`i' & event_windows==1
drop pr
}
运行后出现no observations ,为什么呢?数据类型是数值型,万分感谢呀