本人因为在做merger的论文,需要用stata做event study,先是用http://dss.princeton.edu/online_help/stats_packages/stata/eventstudy.html 网站上给的数据和程序模拟运行了一遍。但在做 estimating normal performance 这步开始,就运行不出来了,
官网上给的程序是:Estimating Normal Performance
set more off /* this command just keeps stata from pausing after each screen of output */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}
我运行出来的结果是:
set more off /* this command just keeps stata from pausing after each screen of output */
varlist not allowed
r(101);.
.
.
. gen predicted_return=.
(46475 missing values generated).
. egen id=group(company_id)
id already defined
r(110);.
. /* for multiple event dates, use: egen id = group(group_id) */
unrecognized command: / invalid command name
r(199);.
. forvalues i=1(1)N { /*note: replace N with the highest value of id */
program error: code follows on the same line as open brace
r(198);.
. l id company_id if id==`i' & dif==0
invalid syntax
r(198);.
. reg ret market_return if id==`i' & estimation_window==1
invalid syntax
r(198);.
. predict p if id==`i'
invalid syntax
r(198);.
. replace predicted_return = p if id==`i' & event_window==1
invalid syntax
r(198);.
. drop p.
. }
unrecognized command: } invalid command name
r(199); 不知道问题出在的哪里,请高人指点,本人感激不尽!!!


雷达卡




[loveliness][loveliness]
京公网安备 11010802022788号







