全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1256 0
2017-11-15

下面这个代码是将每个公司最终的CAR值输出出来,即每个公司CAR(-60,60)的结果。但是请问如何可以将所有公司平均的CAR值按照天数输出出来呢? (-60,60)中每一天的CAR值,即输出121个结果。

sort id date

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(121)) * ( cumulative_abnormal_return /ar_sd)

list company_id cumulative_abnormal_return test if dif==0

outsheet company_id event_date cumulative_abnormal_return test using D:\mystata\stats.csv if dif==0, comma names


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群