Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Non-trading days affecting CAR calculations in eventstudy2

    Hi,

    I’m running a financial event study using eventstudy2 package with international data. I am facing an issue with CAAR calculations due to missing AR for some days within specified windows. I would appreciate some insights!

    Issue:
    As I understand the package setup, the dateline is derived from the dates in the securities return file. Since I have multiple stock market exchanges, a particular date might not be a part of a stock exchange return (and so it should not be derived as part of the dateline), but it is part of the dateline in the eventstudy2 results since that particular date exist in the securities return file for other stock exchanges. Thus, the eventstudy2 results file shows that particular date with a missing AR for the stock exchange market that did not even have that date in the securities file, and it is affecting the CAAR windows calculations. I have events that are 1 business day after the particular date in the stock exchanges that observed that date and the return is missing since there is no return the previous day (i.e., the 'previous day' date does not exist for this exchange but it does exists for other stock exchanges).

    For example, US stock markets are closed on memorial day each year. Memorial day dates are not part of the US-based securities return in the securities return file (or the market return file). However, the date itself exists for the international stock markets since they do not observe memorial day and thus the date itself exists in the securities return file in general. Hence the date exists as part of the dateline, leading to the problem of missing AR for the US based stocks.

    So is there a way to work around this issue? Can I adjust the dateline based on each exchange market code 'separately'?

    For clarity, I will post my data, code, and an example that reflects the problem as described. through dataex to comply with Statalist rules (& screenshots for the problem because it is gentler on the eyes in my opinion!)

    Events data (Partially shown)
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int exchd str8 firm_code double date
    104 "41717M"   20790
      2 "88367150" 14690
    189 "691525"   15683
    163 "741689"   15872
     78 "866035"   17379
     78 "866035"   20572
     73 "675619"   21164
     84 "140598"   16223
     84 "140598"   22012
    104 "900754"   17583
      3 "01625910" 21010
      3 "G0176710" 21263
      3 "01535110" 17897
    end
    format %td date
    Eventstudy2 code
    Code:
    eventstudy2 firm_code date using securities_return, returns(ret_) model(FM) marketfile(world_market_returns_MSCI_rate) marketreturns(MktRF) idmarket(exchcd) factor1(msci_index) factor2(ex_rate) riskfreerate(RF)  
     eswlb(-252) eswub(-30) ///
     evwlb(-5)  evwub(5) ///
     car1LB(0) car1UB(0) ///
     car2LB(-1) car2UB(0) ///
     car3LB(-1) car3UB(1) ///
     car4LB(0) car4UB(1) ///
     car5LB(-1) car5UB(2) ///
     car6LB(0) car6UB(2) ///
     car7LB(-2) car7UB(2) ///
     car8LB(0) car8UB(3) ///
     car9LB(-1) car9UB(3) ///
     car10LB(-2) car10UB(3) ///
     aarfile(licensee_output_average_abn_ret_file_set_1) /// 
     carfile(licensee_output_cum_average_abn_ret_file_set_1) ///
     crossfile(licensee_crossfile_set_1) ///
     arfile(licensee_output_abn_ret_file_set_1) /// 
     diagnosticsfile(licensee_output_diag_set_1) ///
     graphfile(licensee_output_graph_file_set_1) replace

    Securities return file
    (showing dates before/after memorial date for US (31 May 2004 was memorial day in US, US stock markets are closed (exchcd 1,2,3 in the examples are US based no return data on this date) while the same date is a regular trading day in another stock market, in Japan for example with exchcd 200)
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double(date exchcd) str14 firm_code double ret_
    16217   1 "00790310"   .013404812663793564
    16217   1 "04635310"  -.004206114914268255
    16217   1 "07588710"  .0022430792450904846
    16217   1 "11012210"  -.002389540895819664
    16217   1 "23156110"  .0008428342989645898
    16217   1 "23156140"  .0006644247914664447
    16217   1 "24785010" -.0045044999569654465
    16217   1 "26054310"   .007495500613003969
    16217   1 "26353410"   .000935693911742419
    16217   1 "45920010"  -.003945867996662855
    16217   1 "47816010"  .0021676106844097376
    16217   1 "49558210"  -.010502651333808899
    16217   1 "53245710"   .018731767311692238
    16217   1 "54946310"    .06748466938734055
    16217   1 "58933110"  .0019217666704207659
    16217   1 "62007610"   -.02008030191063881
    16217   1 "67010020"  -.006285239011049271
    16217   1 "71708110"   .004317723214626312
    16217   1 "74271810" -.0014848149148747325
    16217   1 "90291110"   .004837417509406805
    16217 200 "912718"      .02222206211505484
    16218   1 "00790310"   .005291000474244356
    16218   1 "04635310"   .011826850473880768
    16218   1 "07588710"   .006714100018143654
    16218   1 "11012210"   .007984062656760216
    16218   1 "23156110" -.0021052309311926365
    16218   1 "23156140" -.0008853677427396178
    16218   1 "24785010" -.0045248824171721935
    16218   1 "26054310"    .02308880351483822
    16218   1 "26353410"   .010049084201455116
    16218   1 "45920010"   .002716444432735443
    16218   1 "47816010"   .005587623920291662
    16218   1 "49558210"   .007581530138850212
    16218   1 "53245710"  .0073549565859138966
    16218   1 "54946310"    .03448272496461868
    16218   1 "58933110"    .01086961105465889
    16218   1 "62007610"   .014344199560582638
    16218   1 "67010020"   .026826683431863785
    16218   1 "71708110"   .014617430046200752
    16218   1 "74271810"    .00910783838480711
    16218   1 "90291110"  .0024070648942142725
    16218 200 "912718"    -.008152016085020697
    16219   1 "00790310"   .023026341572403908
    16219   1 "04635310"   -.02108115889132023
    16219   1 "07588710"   .016976559534668922
    16219   1 "11012210"  .0007920973584987223
    16219   1 "23156110"  -.007384014315903187
    16219   1 "23156140"  -.008639774285256863
    16219   1 "24785010"   .007954510860145092
    16219   1 "26054310"   .000501515984069556
    16219   1 "26353410" -.0004627593152690679
    16219   1 "45920010"                     0
    16219   1 "47816010" -.0014339815825223923
    16219   1 "49558210"   .005267095286399126
    16219   1 "53245710" -.0039210510440170765
    16219   1 "54946310"  -.008333325386047363
    16219   1 "58933110" -.0027409037575125694
    16219   1 "62007610" -.0015150898834690452
    16219   1 "67010020"   -.01975361630320549
    16219   1 "71708110" -.0016949540004134178
    16219   1 "74271810"   -.00699946703389287
    16219   1 "90291110" -.0032016790937632322
    16219 200 "912718"     .021917650250495635
    16222 200 "912718"    -.004021572296714848
    16223   1 "00790310"   -.01607717014849186
    16223   1 "04635310"   .010234531946480274
    16223   1 "07588710"   .005166973918676376
    16223   1 "11012210" -.0003957352018915117
    16223   1 "23156110"   .005313496571034193
    16223   1 "23156140" -.0006703637773171067
    16223   1 "24785010"  .0028185539413243532
    16223   1 "26054310"  -.007518873084336519
    16223   1 "26353410" -.0004629735485650599
    16223   1 "45920010"  -.005305266939103603
    16223   1 "47816010"  .0010770305525511503
    16223   1 "49558210"  -.017215535044670105
    16223   1 "53245710"   .014524226076900959
    16223   1 "54946310"   -.00840335339307785
    16223   1 "58933110"   .022410176694393158
    16223   1 "62007610"   .006069748662412167
    16223   1 "67010020"   .005417117848992348
    16223   1 "71708110"   .003112637437880039
    16223   1 "74271810"   .007234267890453339
    16223   1 "90291110"  -.001070688245818019
    16223 200 "912718"    -.010767094407955091
    16250   1 "00790310"  -.013548390008509159
    16250   1 "04635310"   .004790967330336571
    16250   1 "07588710"  -.002173495478928089
    16250   1 "11012210"    .00773932971060276
    16250   1 "23156110"   .022920548915863037
    16250   1 "23156140"  -.005860139150172472
    16250   1 "24785010"   .006702412851154804
    16250   1 "26054310"  -.004464293364435434
    16250   1 "26353410" -.0006855297251604497
    16250   1 "45920010"  -.009380278177559376
    16250   1 "47816010"   .008623875677585602
    16250   1 "49558210"  -.022881394252181053
    16250   1 "53245710"  .0042016166262328625
    16250   1 "54946310"   -.01315788272768259
    16250   1 "58933110"  .0027659800834953785
    end
    format %td date
    Same in a screenshot: Monday 31 May 2004 is not in data for exchcd==1 (US) while it is available for exhcd==200 (non-US)
    Click image for larger version

Name:	Picture2.png
Views:	2
Size:	117.7 KB
ID:	1712750



    Result showing that May 31 2004 is still in the dateline for US based stocks (all missing AR as the market was closed)
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int(date exchcd) str8 firm_code double(ret_ AR)
    16217 1 "00790310"    .013315763075229733     .03722703990745267
    16218 1 "00790310"    .005277052309434192     .02186938912801005
    16219 1 "00790310"    .022765235975619153    .048854896798964334
    16222 1 "00790310"                      .                      .
    16223 1 "00790310"   -.016207809952934957     .04618243926958206
    16250 1 "00790310"   -.013641006935956101    .012307677726624389
    16251 1 "00790310"    .034075923892179914    .051854568230430075
    16252 1 "00790310"    .005044141969997706     .01979099139513475
    16217 1 "04635310"   -.004214985498139131   -.003287660101806241
    16218 1 "04635310"    .011757459856937135    .011122350946436132
    16219 1 "04635310"   -.021306539674847868   -.019642921885102537
    16222 1 "04635310"                      .                      .
    16223 1 "04635310"    .010182513744634568    .008680343633581876
    16250 1 "04635310"    .004779527171423616    .006884522943666162
    16251 1 "04635310"   -.010457602186322365   -.010503594962317184
    16252 1 "04635310" -.00043812613211842053  -.0012707492939596043
    16217 1 "04635310"   -.004214985498139131  -.0030002355034513947
    16218 1 "04635310"    .011757459856937135    .010557618357608522
    16219 1 "04635310"   -.021306539674847868    -.01865588433444455
    16222 1 "04635310"                      .                      .
    16223 1 "04635310"    .010182513744634568    .013612054876116097
    16250 1 "04635310"    .004779527171423616    .008630313186814967
    16251 1 "04635310"   -.010457602186322365    -.01037799503184684
    16252 1 "04635310" -.00043812613211842053  -.0017273525961142944
    16217 1 "04635310"   -.004214985498139131 .000017281419685614453
    16218 1 "04635310"    .011757459856937135    .012999111686269249
    16219 1 "04635310"   -.021306539674847868   -.015144486700742987
    16222 1 "04635310"                      .                      .
    16223 1 "04635310"    .010182513744634568     .01795801462705153
    16250 1 "04635310"    .004779527171423616     .01269104631887931
    16251 1 "04635310"   -.010457602186322365  -.0074438991455437285
    16252 1 "04635310" -.00043812613211842053   .0008024198680716587
    16217 3 "05349110"    .023905498325814397    .025211490225967855
    16218 3 "05349110"    -.04016600279299834   -.043219055842368986
    16219 3 "05349110"   -.004106777982076516     .00159710572917212
    16222 3 "05349110"                      .                      .
    16223 3 "05349110"                      0  -.0038722259923815727
    16250 3 "05349110"   -.012024181073662292  -.0010152525437440978
    16251 3 "05349110"    .051091613656690515     .05258409556824545
    16252 3 "05349110"    .018975973885088676     .01706931245192092
    16217 1 "11012210"  -.0023924004048501506   -.005040427320117261
    16218 1 "11012210"    .007952358667795291     .00336456401372396
    16219 1 "11012210"   .0007917838149464739 -.00017309460307070486
    16222 1 "11012210"                      .                      .
    16223 1 "11012210" -.00039581352573086825  -.0038144949703310927
    16250 1 "11012210"    .007709534728472392    .008629310591184805
    16251 1 "11012210"  -.0036444726042364505   -.006548659793651547
    16252 1 "11012210"   -.006103767564543146   -.010379797330149073
    16217 1 "26353410"   .0009352564230765682 -.00042717735038888636
    16218 1 "26353410"    .009998927891575374    .005574737277202882
    16219 1 "26353410"  -.0004628664214051847   .0003683943901323195
    16222 1 "26353410"                      .                      .
    16223 1 "26353410"  -.0004630807539084978  -.0038944056009510585
    16250 1 "26353410"  -.0006857648081061937    .002315492736277213
    16251 1 "26353410"     .00955860695660588   .0072185500231432605
    16252 1 "26353410"    .006096815474207856   .0018293813503043434
    16217 3 "34986230"     .03802744924453838     .03570783414309664
    16218 3 "34986230"    -.03415897847349893    -.04103834261383067
    16219 3 "34986230"                      0   .0005864903796464205
    16222 3 "34986230"                      .                      .
    16223 3 "34986230"   -.015564502056306488   -.011627587794875986
    16250 3 "34986230"    .033030494959647265     .03622143031618973
    16251 3 "34986230"   -.007246401439329037   -.011468781902362953
    16252 3 "34986230"    -.04461702197515067     -.0515242992500275
    16217 3 "34986230"     .03802744924453838     .03349301332039578
    16218 3 "34986230"    -.03415897847349893    -.03883203151832472
    16219 3 "34986230"                      0   -.004152288194745779
    16222 3 "34986230"                      .                      .
    16223 3 "34986230"   -.015564502056306488    -.02035549173838485
    16250 3 "34986230"    .033030494959647265    .029468045016373005
    16251 3 "34986230"   -.007246401439329037   -.011474898829033027
    16252 3 "34986230"    -.04461702197515067    -.04907813673563894
    16217 3 "34986230"     .03802744924453838    .031058751245865657
    16218 3 "34986230"    -.03415897847349893   -.041517897371306525
    16219 3 "34986230"                      0   -.006305263843387365
    16222 3 "34986230"                      .                      .
    16223 3 "34986230"   -.015564502056306488   -.015837472179057337
    16250 3 "34986230"    .033030494959647265    .027668971480424014
    end
    format %td date
    Same in a screenshot
    Click image for larger version

Name:	Picture3.png
Views:	1
Size:	198.2 KB
ID:	1712751




    Result showing missing CAR1 for event day (0,0) - event days that fall after a closure in a market
    1 June 2004 --> the event day. The previous day was memorial day Monday May 31 2004 --> Nasdaq was closed.
    27-Nov-09 --> event day. The previous day was Thanksgiving in the US Thursday 26 Nov 2009 --> NYSE was closed.
    Same cases for all missing events CARs---> What these events have in common is that they fall AFTER a stock market holiday BUT the date is a trading day in other stock markets (& thus part of the dateline).


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str8 firm_code int(exchd original_event_date event_date) float _BETA double(CAR1 CAR2 CAR3 CAR4)
    "42369K10"   3 16223 16223  .6351219 . -.020952070131897926   .014589250198612486 .
    "61166W10"   1 18228 18228  .7275975 . .0051347747980870495   .021256940016407065 .
    "66987V10"   1 22663 22663   .406177 . .0012890455443940255 -.0016283653625692538 .
    "69348310"   1 19297 19297 1.2395663 .                    .                     . .
    "69350610"   1 17804 17804 1.0578572 .   .01713401733460579   -.02411750354040599 .
    "77870H"    73 19281 19281  .3887966 .   .18356747996898123    .18135987014414498 .
    "80105N10"   3 19604 19604 1.1800137 . -.011097764148765095   -.01379767490917141 .
    "912085"   200 21553 21553  .7299547 .                    .                     . .
    "912636"   200 18749 18749 1.3439546 . -.013736212522747693                     . .
    "91301710"   1 17413 17413   .898518 . -.012983853812793478   -.01742347053720527 .
    "G8534710"   3 21200 21200  .7526627 .   .06105015327479994 -.0016337488032201614 .
    end
    format %d original_event_date
    format %d event_date

    same as a screenshot
    Click image for larger version

Name:	Picture4.png
Views:	1
Size:	110.6 KB
ID:	1712752



    Please let me know if I could clarify the question further! I appreciate your help!
    Dalal
    Attached Files

  • #2
    Dear Sir,

    Thank you for your question. You described the problem correctly; you also stated correctly how eventstudy2 is handling the "dateline", i.e., it always defines one common dateline for all securities and exchanges.

    You can workaround by modifying the date variable so that it does not overlap in calendar time across markets. I think that adding a huge interger constant to all date values for one particular market, e.g. the US, takes them effectively off the common dateline (you will have to perform the operation for the concerend event dates in memory, the concerend data in the security return file, and the concerend data in market return file -- but only the concerned data; if you shift everyhing, this will not change anything).

    For example if you add 36500 to all date variables of US firm data, you shift all concerned data 100 years into the future while the data for the other exchanges/countries remains where they are. Memorial day should then only affect the US firm events. You can do this for any exchange, e.g.,. shift the Luxembourgish firms by 50 years, the Italian ones by 150....

    I have never tried this, but I think it should work. Please let the community know whether it does.

    Thanks.
    Thomas

    Comment


    • #3
      Hello,

      A late update: the solution worked. Thank you!

      However, shifting concerned data 100 or 150 years into the future affected the day of the trade. So I suddenly had Saturdays and Sundays in my "shifted" data. So, I shifted them 400 years into the future to maintain the day/date(dd/mm) combination. I chose 400 years based on asking ChatGPT this question "How often in years do calendars repeat with the same day-date combinations?"

      The answer I got:
      "The Gregorian calendar, which is the most widely used calendar system today, repeats with the same day-date combinations every 400 years. This 400-year cycle is primarily due to the way leap years are handled in the Gregorian calendar.

      In the Gregorian calendar:
      1. Most years have 365 days.
      2. Every 4th year is a leap year, adding an extra day (February 29) to the calendar, making it 366 days long.
      3. However, years that are divisible by 100 are not leap years unless they are also divisible by 400.
      This rule ensures that while most leap years occur every 4 years, there are exceptions (years divisible by 100 but not by 400) that are not leap years. This adjustment helps keep the calendar year roughly synchronized with the solar year, making the average year length approximately 365.2425 days.

      Because of this 400-year cycle, the same day-date combinations will repeat every 400 years in the Gregorian calendar. This means that if a particular date (e.g., January 1, 2023) falls on a Sunday, you can expect it to fall on a Sunday again exactly 400 years later (e.g., January 1, 2423)."

      So the solution appears to work. and my problem is solved. Thanks again!

      Comment

      Working...
      X