Hi guys.
I am doing an event-study using high-frequency financial data and I would appreciate if you could help me with the below.

As you can see I have an event which occurs on 04 Jan 2006 at 10:00, which I have defined as being evday=0 on stata.
I need to define an estimation window which spans over prior 10 days for example but only 30 minutes prior to the time the event occurred, that is at 10:00. It would look like the above, i.e. my event window would then be an aggregation of days -1, -10, covering only times from 09:29 to 09.59.
Below is a snapshot of my data. I've only included 2 days of data from 09:35 to 10:59 each day not to make it too heavy for a post on the forum.
Any insights on how I can work around this? Any tips on the commands I need to use would be much appreciated.
Thank you for any forthcoming replies.
P.S
My apologies if the picture is inappropriate for a post on the forum. I was not really sure how to explain what I'm trying to do other than putting it in graphical form!
I am doing an event-study using high-frequency financial data and I would appreciate if you could help me with the below.
As you can see I have an event which occurs on 04 Jan 2006 at 10:00, which I have defined as being evday=0 on stata.
I need to define an estimation window which spans over prior 10 days for example but only 30 minutes prior to the time the event occurred, that is at 10:00. It would look like the above, i.e. my event window would then be an aggregation of days -1, -10, covering only times from 09:29 to 09.59.
Below is a snapshot of my data. I've only included 2 days of data from 09:35 to 10:59 each day not to make it too heavy for a post on the forum.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 underlying_symbol double dt float return_sp500 "^SPX" 1451899860000 . "^SPX" 1451899920000 .0005744325 "^SPX" 1451899980000 .00027911077 "^SPX" 1451900040000 -.0003828115 "^SPX" 1.4519001e+12 .0000558926 "^SPX" 1451900160000 -.0003430974 "^SPX" 1451900220000 7.9871415e-06 "^SPX" 1451900280000 -.00013569267 "^SPX" 1451900340000 -.0003511525 "^SPX" 1.4519004e+12 .0002713648 "^SPX" 1451900460000 -.00001597779 "^SPX" 1451900520000 .00013570566 "^SPX" 1451900580000 .00015954993 "^SPX" 1451900640000 .000015973073 "^SPX" 1.4519007e+12 .0004707015 "^SPX" 1451900760000 -.00022334624 "^SPX" 1451900820000 -.00055858394 "^SPX" 1451900880000 -.00017557766 "^SPX" 1451900940000 .000071813236 "^SPX" 1.451901e+12 .00016767405 "^SPX" 1451901060000 .000335069 "^SPX" 1451901120000 -.00025528512 "^SPX" 1451901180000 -.0003272616 "^SPX" 1451901240000 -.0005828862 "^SPX" 1.4519013e+12 -.00021569553 "^SPX" 1451901360000 .000135839 "^SPX" 1451901420000 .00004787568 "^SPX" 1451901480000 .00014380828 "^SPX" 1451901540000 .0003752666 "^SPX" 1.4519016e+12 .00013574358 "^SPX" 1451901660000 -.0003273556 "^SPX" 1451901720000 .0006864562 "^SPX" 1451901780000 .0003909086 "^SPX" 1451901840000 -.0007899605 "^SPX" 1.4519019e+12 -.0005988766 "^SPX" 1451901960000 -.0007350496 "^SPX" 1451902020000 .00043947555 "^SPX" 1451902080000 -.00008787966 "^SPX" 1451902140000 -.00089533 "^SPX" 1.4519022e+12 -.0004879629 "^SPX" 1451902260000 .000416009 "^SPX" 1451902320000 -.0004560565 "^SPX" 1451902380000 -.00048020715 "^SPX" 1451902440000 .0002961631 "^SPX" 1.4519025e+12 .00011205206 "^SPX" 1451902560000 -.0000880189 "^SPX" 1451902620000 .000071998285 "^SPX" 1451902680000 -.000071998285 "^SPX" 1451902740000 -.000016022033 "^SPX" 1.4519028e+12 .0003840673 "^SPX" 1451902860000 .000072069444 "^SPX" 1451902920000 -.000032030224 "^SPX" 1451902980000 -.0006402337 "^SPX" 1451903040000 .00013611083 "^SPX" 1.4519031e+12 -.0007045958 "^SPX" 1451903160000 .00002405182 "^SPX" 1451903220000 -.0003525246 "^SPX" 1451903280000 -.00009614685 "^SPX" 1451903340000 -.00056904997 "^SPX" 1.4519034e+12 .00015227412 "^SPX" 1451903460000 .0003366627 "^SPX" 1451903520000 -.00024849916 "^SPX" 1451903580000 -.00018435974 "^SPX" 1451903640000 -.00013623667 "^SPX" 1.4519037e+12 -.00012832608 "^SPX" 1451903760000 -.00012834255 "^SPX" 1451903820000 -.00008821447 "^SPX" 1451903880000 -.0004332548 "^SPX" 1451903940000 0 "^SPX" 1.451904e+12 -.0003691589 "^SPX" 1451904060000 .0003130297 "^SPX" 1451904120000 .0005615423 "^SPX" 1451904180000 .0000802785 "^SPX" 1451904240000 .0002726051 "^SPX" 1.4519043e+12 .000032100845 "^SPX" 1451904360000 -.000072228344 "^SPX" 1451904420000 .00008015553 "^SPX" 1451904480000 .00016841335 "^SPX" 1451904540000 .0003206017 "^SPX" 1.4519046e+12 .00005604828 "^SPX" 1451904660000 -.00004812503 "^SPX" 1451904720000 .00013625044 "^SPX" 1451904780000 -.00006406376 "^SPX" 1451904840000 .00008812328 "^SPX" 1.4519049e+12 -.00017625434 "^SPX" 1451904960000 .0003845504 "^SPX" 1451905020000 .000016036023 "^SPX" 1451905080000 -.000160274 "^SPX" 1451905140000 -.00017624305 "^SPX" 1451986260000 -.00007100496 "^SPX" 1451986320000 .00003155838 "^SPX" 1451986380000 -.0003625965 "^SPX" 1451986440000 -.0004337873 "^SPX" 1.4519865e+12 .00048893585 "^SPX" 1451986560000 .00014983857 "^SPX" 1451986620000 -.00002367242 "^SPX" 1451986680000 -.0003469711 "^SPX" 1451986740000 .00021291306 "^SPX" 1.4519868e+12 .0003941353 "^SPX" 1451986860000 .000023666267 end format %tc dt
Thank you for any forthcoming replies.
P.S
My apologies if the picture is inappropriate for a post on the forum. I was not really sure how to explain what I'm trying to do other than putting it in graphical form!
Comment