楼主: liuchang1989
3406 8

[数据管理求助] 问问Princeton里event study关于停牌处理 [推广有奖]

  • 1关注
  • 2粉丝

已卖:10份资源

讲师

32%

还不是VIP/贵宾

-

威望
0
论坛币
736 个
通用积分
0.0026
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
4035 点
帖子
424
精华
0
在线时间
462 小时
注册时间
2010-4-27
最后登录
2017-4-10

楼主
liuchang1989 发表于 2014-2-15 19:46:57 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
下面是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不是空值?

欢迎各位回答, 提出好的解
二维码

扫码加我 拉你入群

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

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

关键词:event study princeton PRINCE study Event number target count 程序

沙发
liuchang1989 发表于 2014-2-16 20:35:43
想增加一个循环让它找到离event_day 最近的trading day

藤椅
jjjj6666 发表于 2014-2-16 23:36:17
gen double d=abs(event_day-trading_day)
egen double x= min(d), by(group_id)
gen evt_dat_near_t_day =trading_day if x==d

?

板凳
liuchang1989 发表于 2014-2-17 11:08:26
jjjj6666 发表于 2014-2-16 23:36
gen double d=abs(event_day-trading_day)
egen double x= min(d), by(group_id)
gen evt_dat_near_t_day ...
Much thanks, will take a look.

报纸
liuchang1989 发表于 2014-2-17 20:25:49
jjjj6666 发表于 2014-2-16 23:36
gen double d=abs(event_day-trading_day)
egen double x= min(d), by(group_id)
gen evt_dat_near_t_day ...
I solve the problem like this:

gen absdif=abs(stockdate-event_date)
egen abstd=min(absdif),by(group_id)
replace dif=abstd-absdif if dif==. & event_date>=stockdate
replace dif=absdif-abstd if dif==. & event_date<stockdate

地板
liuchang1989 发表于 2014-2-17 22:44:11
jjjj6666 发表于 2014-2-16 23:36
gen double d=abs(event_day-trading_day)
egen double x= min(d), by(group_id)
gen evt_dat_near_t_day ...
QQ图片20140217223525.jpg QQ图片20140217223504.jpg
Hi, I met a new obstable when running the regression below, the error is shown as above.
The reason is, in some certain cases, the first row of the return is empty (something wrong with the data), but the security info of the first stockdate often would not be used in the regression, but stata shows "no observations".

How could i jump it or neglect it? I tried to drop id=194, but it does not work.

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}

7
jjjj6666 发表于 2014-2-18 00:25:29
if you want to ignore the error, try using "cap" in font of reg or the command resulted that error

8
goajia1989 发表于 2016-3-9 22:09:05
楼主好,我现在想看这个东西,链接我打不开,所以能不能麻烦你把这个代码和数据给我下。584912990@qq.com  

9
嘿嘿1021 发表于 2016-3-18 09:33:47
楼主,我做的是停牌的研究,所以我想把事件窗口设置为每只股票的停复牌整个时间段,即有两个事件日期,这种情况的代码怎么写呢,

感激不尽~

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 10:12