事件研究线性回归误差

时间:2016-03-30 20:01:43

标签: stata linear-regression

事件研究错误:

在线性回归中,无法识别自变量。我不知道问题所在的位置,从而使R ^ 2为0.00。

我作为我的活动研究的基础,普林斯顿的以下指南:http://dss.princeton.edu/online_help/stats_packages/stata/eventstudy.html

这是我的代码:

sort group_id date
by group_id: gen datenum=_n
by group_id: gen target=datenum if date==fdate
egen td=min(target), by(group_id)
drop target
gen dif=datenum-td

by group_id: gen event_window=1 if dif>=-20 & dif<=20
egen count_event_obs=count(event_window), by(group_id)
replace event_window=0 if event_window==.
tab group_id if count_event_obs<41
drop if count_event_obs < 41


by group_id: gen estimation_window=1 if dif<-200 & dif>=-400
egen count_est_obs=count(estimation_window), by(group_id)
replace estimation_window=0 if estimation_window==.
tab group_id if count_est_obs<200
drop if count_est_obs < 200



set more off 

gen predicted_return=.
egen id=group(group_id) 

forvalues i=1(1)1169 {  
    l id group_id if id==`i' & dif==0
    reg ret vwretd if id==`i' & estimation_window==1 
    predict p if id==`i'
    replace predicted_return = p if id==`i' & event_window==1 
    drop p
}  
sort id comnam
gen abnormal_return=ret-predicted_return if event_window==1
by id: egen cumulative_abnormal_return = sum(abnormal_return)

sort id date
by id: egen ar_sd = sd(abnormal_return) 
gen test =(1/sqrt(41)) * ( cumulative_abnormal_return /ar_sd) 
list comnam cumulative_abnormal_return test if dif==0     

reg cumulative_abnormal_return if dif==0, robust

this is my regression outout

0 个答案:

没有答案