Announcement

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

  • How to calculate Buy-and-hold Abnormal Return (BHAR) ?

    We use the income from May of T+1 to April of T+2 as T annual income.BHAR is equal to the multiplier of each company's 12-month revenue in a year, and then subtracts the 12-month revenue multiplication of the market in a year.For example, A company's 2015 BHAR is equal to the company's monthly yield from May 2016 to April 2017, and then subtracted the yield from May 2016 to April 2017.This is too complicated, I really can't figure it out, so ask questions.
    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str6 code str7 date double(IT MT)
    "000002" "2009-01"  .091473  .157394
    "000002" "2009-02"  .015625   .08893
    "000002" "2009-03"  .158042  .223024
    "000002" "2009-04"  .024155  .076364
    "000002" "2009-05"  .148585  .071731
    "000002" "2009-06"  .314909  .088737
    "000002" "2009-07"  .047843  .148047
    "000002" "2009-08" -.296407  -.15897
    "000002" "2009-09"  .108511  .045235
    "000002" "2009-10"  .104607  .120721
    "000002" "2009-11"  .001738  .146828
    "000002" "2009-12" -.062446  .025708
    "000002" "2010-01" -.135985 -.032345
    "000002" "2010-02"  .009636  .066523
    "000002" "2010-03"  .007423  .042699
    "000002" "2010-04" -.178947 -.070492
    "000002" "2010-05" -.066826 -.085053
    "000002" "2010-06" -.059639 -.092684
    "000002" "2010-07"  .222714  .152968
    "000002" "2010-08"  .015682  .091707
    "000002" "2010-09" -.002375  .014685
    "000002" "2010-10"  .154762  .092551
    "000002" "2010-11" -.161856  .008053
    "000002" "2010-12"   .01107   -.0194
    "000002" "2011-01" -.002433 -.049277
    "000002" "2011-02" -.004878  .097416
    "000002" "2011-03"  .064951 -.005443
    "000002" "2011-04" -.024166 -.029671
    "000002" "2011-05" -.063769 -.073427
    "000002" "2011-06"  .077806  .037579
    "000002" "2011-07" -.035503  .021129
    "000002" "2011-08"        0 -.028933
    "000002" "2011-09" -.111656 -.117144
    "000002" "2011-10"  .104972   .03965
    "000002" "2011-11"   -.1175 -.044145
    "000002" "2011-12"  .058074 -.155997
    "000002" "2012-01"  .024096  .007288
    "000002" "2012-02"  .082353  .130467
    "000002" "2012-03"        0 -.072395
    "000002" "2012-04"  .084541  .075331
    "000002" "2012-05"  .030067  .020294
    "000002" "2012-06" -.036757 -.064925
    "000002" "2012-07"   .05041 -.092077
    "000002" "2012-08" -.131094  .019197
    "000002" "2012-09"  .051122   .01457
    "000002" "2012-10" -.013049   .00558
    "000002" "2012-11"  .051683 -.108443
    "000002" "2012-12"  .156571  .166233
    "000002" "2013-01"  .186759  .065083
    "000002" "2013-02" -.000833  .043567
    "000002" "2013-03" -.103333 -.033948
    "000002" "2013-04"  .025093 -.032165
    "000002" "2013-05"  .102837   .13469
    "000002" "2013-06" -.177796 -.163374
    "000002" "2013-07" -.033503  .062773
    "000002" "2013-08" -.006303  .092286
    "000002" "2013-09" -.034884  .048109
    "000002" "2013-10"  .008762 -.020632
    "000002" "2013-11"  -.04886  .071771
    "000002" "2013-12" -.083333  -.03295
    "000002" "2014-01" -.080946  .005079
    "000002" "2014-02" -.089431  .043985
    "000002" "2014-03"  .203869 -.017824
    "000002" "2014-04" -.023486 -.012822
    "000002" "2014-05"  .142649  .024008
    "000002" "2014-06" -.032749  .040563
    "000002" "2014-07"  .197098  .092952
    "000002" "2014-08" -.078788  .060615
    "000002" "2014-09"  .006579  .143076
    "000002" "2014-10"  .023965  .023014
    "000002" "2014-11"  .159574  .063455
    "000002" "2014-12"  .275229 -.010609
    "000002" "2015-01" -.056115  .072194
    "000002" "2015-02" -.028201   .07249
    "000002" "2015-03"  .083922  .224049
    "000002" "2015-04"   .05644  .189475
    "000002" "2015-05" -.017123  .270192
    "000002" "2015-06"  .011847 -.076295
    "000002" "2015-07"  .010236 -.166447
    "000002" "2015-08" -.026798 -.131148
    "000002" "2015-09" -.077536  -.05459
    "000002" "2015-10"  .073841  .218789
    "000002" "2015-11"  .102414  .108848
    "000002" "2015-12"  .621102  .076944
    "000002" "2016-07" -.268932  .010287
    "000002" "2016-08"  .454492  .053706
    "000002" "2016-09"  .049739 -.003338
    "000002" "2016-10" -.047765   .04209
    "000002" "2016-11"  .082665  .037181
    "000002" "2016-12" -.238325 -.034747
    "000002" "2017-01"  .006326 -.017722
    "000002" "2017-02" -.007253  .052976
    "000002" "2017-03"  .002435 -.015306
    "000002" "2017-04" -.052478 -.056799
    "000002" "2017-05"  .090256 -.076485
    "000002" "2017-06"  .174506  .041879
    "000002" "2017-07" -.064077  .003885
    "000002" "2017-08"  .027624  .038274
    "000002" "2017-09"  .130004  .010294
    "000002" "2017-10"  .103238 -.010664
    end
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 249277 observations

  • #2
    firstly, you need to generate some vars, like generate a sequent id variable, -by code egen id=_n. - and a year variable ,a month variable. then use -forvalues i=1/_N{ }- to calculate this value, should be convenient.

    Comment

    Working...
    X