下面是princeston event study的code
http://dss.princeton.edu/online_help/analysis/eventstudy.html
其中未考虑到在事件那天股市休盘或者那个股票停牌 对应到princeton中的程序段应该在:
use acqstockprice_3,replace
sort group_id stockdate
by group_id: gen datenum=_n
by group_id: gen target=datenum if stockdate==event_date //Cautious here:may not on the trading day or the stock is suspended on that day.
egen td=min(target),by(group_id)
drop target
gen dif=datenum-td // dif: count the number of days from the observation
注意我们该怎么把蓝色修改一下 做一个循环 使得程序找不到stockdate==event_date时,这个产生的target不是空值?
欢迎各位回答, 提出好的解


雷达卡




京公网安备 11010802022788号







