花了3天时间,包括一天的等待(回归过程真的好慢),终于搞清楚了用市场模型针对一个公司多个事件的超额回报率计算。
以下为stata的实现过程(借鉴了普林斯顿大学的教程https://dss.princeton.edu/online_help/stats_packages/stata/eventstudy.html):

*1.合并并购事件
use /Users/DATA/GTA_M&A_Main_累计超额收益率.dta, clear
joinby companyid using 日个股收益率07_19_total_merge.dta

*2.处理数据,生成dif /此处由于一个公司会有多个事件,所以需要sort 多个变量,其中 firstdeclaredate为并购的首次宣告日/

sort companyid firstdeclaredate date
by companyid firstdeclaredate :gen date_num = _n
by companyid firstdeclaredate :gen target = date_num if date == firstdeclaredate
egen td = min(target),by(companyid firstdeclaredate)
drop target
gen dif = date_num - td

*3.设定时间窗口
by companyid firstdeclaredate :gen event_window = 1 if dif >= -1 & dif <= 1
egen count_event_obs = count(event_window),by(companyid firstdeclaredate )
by companyid firstdeclaredate :gen estimation_window = 1 if dif >= -150 & dif < -30
egen count_est_obs = count(estimation_window),by(companyid firstdeclaredate)
replace event_window=0 if event_window ==.
replace estimation_window=0 if estimation_window ==.
tab companyid if count_event_obs<3
tab companyid if count_est_obs<120
drop if count_event_obs<3
drop if count_est_obs<120

4.估计事件期间的正常报酬率
set more off /
this command just keeps stata from pausing after each screen of output */

gen predicted_return=.
egen id=group(companyid firstdeclaredate )
/此处id也要考虑一个公司的多个事件/
forvalues i=1(1)8 { /*note: replace 8 with the highest value of id */
l id companyid if id==i' & dif==0 reg dretwd cdretwdos if id==i’ & estimation_window1
predict p if idi' replace predicted_return = p if id==i’ & event_window==1
drop p
}

*5.计算非正常报酬率与累计非正常报酬率
sort id date
gen abnormal_return=dretwd-predicted_return if event_window==1
by id: egen cumulative_abnormal_return = sum(abnormal_return)

*6.检验显著性
sort id date
by id: egen ar_sd = sd(abnormal_return)
gen test =(1/sqrt(3)) * ( cumulative_abnormal_return /ar_sd)
list companyid firstdeclaredate cumulative_abnormal_return test if dif==0

*7.输出结果
outsheet eventid Main_institutionid companyid firstdeclaredate cumulative_abnormal_return test using stats.csv if dif==0, comma names

*8.对整个事件做稳健性检验
reg cumulative_abnormal_return if dif==0, robust

事件研究法——stata实现并购的超额回报率计算相关推荐

  1. 事件研究法笔记 - Stata连享会

    作者:连玉君 (知乎 | 简书 | 码云) Stata连享会   计量专题 || 精品课程 || 推文   事件研究法 (Event Study) 由 Ball& Brown (1968) 以 ...

  2. Stata:短期事件研究法(Event_Study)教程

    原文链接:https://www.lianxh.cn/news/90de95e42e8ff.html 目录 1. 短期事件研究法概览 1.1 短期事件研究法的定义 1.2 短期事件研究法的理论框架 1 ...

  3. 事件研究法:Stata该用什么命令

    全文阅读:https://www.lianxh.cn/news/a074eb816bd6d.html 目录 1. 事件研究法简介 1.1 什么是事件研究法 1.2 事件研究法应用的问题 2. 事件研究 ...

  4. python做事件研究法_35行代码搞定事件研究法(上)

    作者简介: 祝小宇,个人公众号:大猫的R语言课堂 这期大猫课堂将会教大家如何用35行R代码写出最有效率的事件研究法. 注意,本代码主要使用data.table完成,关于data.table包的相应知识 ...

  5. 多期DID和事件研究法含文献和do代码

    多期DID和事件研究法含文献和do代码 1.方法:多期DID 2来源:JDE发表的一篇多期DID和事件研究法相关的文章, 文章名为为"Here waits the bride? The ef ...

  6. 事件研究法与其应用(2)---Excel实操步骤

    我们借着学习事件研究法的应用,可以用Excel和Stata等软件进行操作. 今天这主要是利用EXCEL计算累积异常收益率. 在正式开展实操之前,我们先回顾一下事件研究法的步骤(尤其是我们写作论文的时候 ...

  7. 35行代码搞定事件研究法(下)

    作者简介: 祝小宇,个人公众号:大猫的R语言课堂 前文推送: 35行代码搞定事件研究法(上) Hello亲爱的小伙伴们,上期已经讲到如何对单一事件日计算超额收益,本期将会教大家如何针对多个股票多个事件 ...

  8. 事件研究法python代码

    事件研究法(event study)由Ball & Brown(1968)以及Famaetal(1969)开创,其原理是基于有效市场假说,通过研究某一未预期到的事件发生前后样本股票收益率的异常 ...

  9. 35行代码搞定事件研究法(上)

    作者简介: 祝小宇,个人公众号:大猫的R语言课堂 这期大猫课堂将会教大家如何用35行R代码写出最有效率的事件研究法. 注意,本代码主要使用data.table完成,关于data.table包的相应知识 ...

最新文章

  1. java面试笔试大汇总(一)
  2. 网狐棋牌(五) TCPSocketEnging分析
  3. 再赠邓超明(帮别人名字作诗)
  4. Python: 使用装饰器“@”取得函数执行时间
  5. gRPC服务注册发现及负载均衡的实现方案与源码解析
  6. STM32_ADC初始化参数说明以及常用的固件库
  7. git 空提交和重置提交者(转载)
  8. sql 标量子查询_SQL Server 2017:标量子查询简化
  9. id图像上传,方便超链接。
  10. android 获取录音时长_录音转文字,支持安卓和IOS和PC
  11. iPhone 14 Pro Max拆解:内部元器件供应商名单
  12. ASO学习笔记整理——关键字优化步骤
  13. 三维提取等值面的重建方法Marching Cubes
  14. 企业网站专业性诊断评价
  15. NO 00004 iOS实现打砖块游戏 一 素材的制作
  16. MySQL慢查询配置和使用
  17. 开机hidl报错修改
  18. 每日C语言代码(The fourth day)——冒泡排序与地址传递
  19. 你真的榨干QQ潜能了吗?QQ技巧全面分享
  20. Web Service漏洞挖掘

热门文章

  1. 人工智能革命:一个在ANI上运行的世界
  2. CentOS7安装K8S V1.23.3
  3. Python下载echo歌曲
  4. scrapy爬取斗图表情
  5. 【牛客内部题:富婆价值最大化!】模拟贪心C++
  6. 召集令——巴布洛游牧节一日游活动开启啦!
  7. python如何读取outlook邮件_通过MAPI使用Python从Outlook中阅读电子邮件
  8. 英语基础太差,能学好编程吗?
  9. CSS略详细的基础 助你一臂之力
  10. 樊登读书会终身成长读后感_(完整版)《终身成长》读后感