STATA代码问题,跪求帮助,急!!!!

本人做event study中,参考princeton大学给的代码整理数据,但是运行到下面的时候总是提示错误,跪求大神解救!!!急!!!!感激不尽!!!!!

源代码如下:
forvalues i=1(1)r(max){/*note:replace N with the highest value of id*/
list id Stkcd if id=='i' & dif==0
reg Dretwd Mkttrt if id=='i' & estimation_window==1
predict p if id=='i' /*此处i是什么???*/
replace predicted_return=p if id=='i' & event_window==1
drop p
}
错误提示:
invalid syntax
r(198);

把forvalues i=1(1)r(max){
改为
forvalues i=1(1)`r(max)'{
试试
温馨提示:答案为网友推荐,仅供参考
相似回答