Announcement

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

  • Cross-sectional dummies

    Below is the data example:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float stock_id str52 stock float(date mdate time rt idiovol size)
    1 "3M IN Equity" 17013 558   1 -.036770534 .1011703  9.467704
    1 "3M IN Equity" 17044 559   2  .014432302 .0735412  9.436299
    1 "3M IN Equity" 17074 560   3   .13803591 .0827738  9.456098
    1 "3M IN Equity" 17105 561   4   .03408287 .1185964  9.599568
    1 "3M IN Equity" 17135 562   5   .09349497  .083371   9.63919
    1 "3M IN Equity" 17166 563   6  .002612613 .0820645  9.738257
    1 "3M IN Equity" 17197 564   7   .11077994 .0466454  9.746859
    1 "3M IN Equity" 17225 565   8  .016851991 .0865417  9.863938
    1 "3M IN Equity" 17256 566   9  -.10867972  .094335  9.887021
    1 "3M IN Equity" 17286 567  10  .066623226 .0797749  9.784989
    1 "3M IN Equity" 17317 568  11   .12015738 .0691696  9.857738
    1 "3M IN Equity" 17347 569  12   .06916329 .0807489  9.984053
    1 "3M IN Equity" 17378 570  13  -.13589363 .1245477 10.059378
    1 "3M IN Equity" 17409 571  14  -.05273496 .0606982  9.927201
    1 "3M IN Equity" 17439 572  15   .03845983 .0867076  9.880385
    1 "3M IN Equity" 17470 573  16   .21140064 .0637702  9.924825
    1 "3M IN Equity" 17500 574  17  -.14600416 .1530644 10.142317
    1 "3M IN Equity" 17531 575  18   .15420267 .0837717  10.00258
    1 "3M IN Equity" 17562 576  19   -.2109012 .1357227 10.162908
    1 "3M IN Equity" 17591 577  20   .03969465  .120556  9.958065
    1 "3M IN Equity" 17622 578  21  -.08240026 .1182923 10.003955
    1 "3M IN Equity" 17652 579  22   .01546719 .1280075  9.927578
    1 "3M IN Equity" 17683 580  23  -.02143945  .085778  9.949172
    1 "3M IN Equity" 17713 581  24  -.09904782 .0645067  9.933963
    1 "3M IN Equity" 17744 582  25  -.04853084 .0848506   9.84219
    1 "3M IN Equity" 17775 583  26 -.006307103 .0734272  9.801457
    1 "3M IN Equity" 17805 584  27   -.1360846 .0781481  9.802704
    1 "3M IN Equity" 17836 585  28   -.4220445 .0827646  9.673755
    1 "3M IN Equity" 17866 586  29 -.010259523 .1277703  9.257906
    1 "3M IN Equity" 17897 587  30 -.006839863 .0818812    9.2536
    1 "3M IN Equity" 17928 588  31   .02454021 .0590921  9.250684
    1 "3M IN Equity" 17956 589  32  -.04923599 .0814866  9.279215
    1 "3M IN Equity" 17987 590  33 -.017418867  .054592  9.233935
    1 "3M IN Equity" 18017 591  34   .13303009 .1238528  9.220645
    1 "3M IN Equity" 18048 592  35    .1889073 .2051834  9.356439
    1 "3M IN Equity" 18078 593  36   .03751833 .1291256   9.54811
    1 "3M IN Equity" 18109 594  37    .1135468 .1162758  9.588391
    1 "3M IN Equity" 18140 595  38  .071983024 .0627696  9.704634
    1 "3M IN Equity" 18170 596  39   .10945003 .0749616  9.779449
    1 "3M IN Equity" 18201 597  40  -.04184333  .120605  9.891526
    1 "3M IN Equity" 18231 598  41   .05014676 .0571009  9.852378
    1 "3M IN Equity" 18262 599  42   .04479511 .0654823  9.905254
    1 "3M IN Equity" 18293 600  43 -.013388447 .0384844  9.953118
    1 "3M IN Equity" 18321 601  44   .09647653 .0526411  9.943072
    1 "3M IN Equity" 18352 602  45   .07632554 .0646166 10.042994
    1 "3M IN Equity" 18382 603  46   .04146759  .079956 10.122968
    1 "3M IN Equity" 18413 604  47    .0897643 .0695088 10.167915
    1 "3M IN Equity" 18443 605  48   .08081475 .1355947 10.261876
    1 "3M IN Equity" 18474 606  49   .22682495 .0634432 10.347093
    1 "3M IN Equity" 18505 607  50   -.0559137 .0952458 10.578698
    1 "3M IN Equity" 18535 608  51   .17378306 .0463608 10.527944
    1 "3M IN Equity" 18566 609  52 -.031280402 .0887449    10.707
    1 "3M IN Equity" 18596 610  53  -.07702992 .1219459  10.68143
    1 "3M IN Equity" 18627 611  54  .005710293 .0517299 10.610112
    1 "3M IN Equity" 18658 612  55  -.04722994 .0478958  10.62181
    1 "3M IN Equity" 18686 613  56  -.06832809  .051112 10.580603
    1 "3M IN Equity" 18717 614  57  .018473858 .0409649 10.518229
    1 "3M IN Equity" 18747 615  58   .19313723 .0521206 10.542795
    1 "3M IN Equity" 18778 616  59  -.05091413 .0794389 10.742197
    1 "3M IN Equity" 18808 617  60   .05662073 .0508011  10.69807
    1 "3M IN Equity" 18839 618  61   .06529239 .0546355 10.761512
    1 "3M IN Equity" 18870 619  62   .01528183 .0752915   10.8338
    1 "3M IN Equity" 18900 620  63  -.10900238 .1159891 10.856077
    1 "3M IN Equity" 18931 621  64  .019783264 .0418763 10.754105
    1 "3M IN Equity" 18961 622  65   -.1201457 .0495351 10.781093
    1 "3M IN Equity" 18992 623  66  -.08063084 .0836783 10.668292
    1 "3M IN Equity" 19023 624  67  .007764093 .0654542 10.594726
    1 "3M IN Equity" 19052 625  68   .04713859 .0596579 10.609765
    1 "3M IN Equity" 19083 626  69   -.0457538 .0684043 10.664457
    1 "3M IN Equity" 19113 627  70   .10354781 .0680345 10.626222
    1 "3M IN Equity" 19144 628  71  -.13608316 .1030622 10.736774
    1 "3M IN Equity" 19174 629  72   .07270864 .0752011 10.607686
    1 "3M IN Equity" 19205 630  73  -.05729704 .0488388  10.68732
    1 "3M IN Equity" 19236 631  74   .08389731 .0645346  10.63681
    1 "3M IN Equity" 19266 632  75 -.006823643 .0395406 10.727564
    1 "3M IN Equity" 19297 633  76  -.06051001 .0369128 10.727527
    1 "3M IN Equity" 19327 634  77   .06374578 .0512648 10.673804
    1 "3M IN Equity" 19358 635  78 -.020162856 .0665782  10.74437
    1 "3M IN Equity" 19389 636  79 -.031567298 .0412854 10.731029
    1 "3M IN Equity" 19417 637  80  -.12454592 .0464434 10.706075
    1 "3M IN Equity" 19448 638  81   .05785021 .0439527  10.58828
    1 "3M IN Equity" 19478 639  82 -.068107605 .0835148 10.652952
    1 "3M IN Equity" 19509 640  83  .011020347  .067512 10.591145
    1 "3M IN Equity" 19539 641  84  -.03942894 .0468325 10.608257
    1 "3M IN Equity" 19570 642  85 -.019227963 .0514239 10.575057
    1 "3M IN Equity" 19601 643  86  -.15240055 .0542408  10.56521
    1 "3M IN Equity" 19631 644  87  .010561404 .0478129 10.422827
    1 "3M IN Equity" 19662 645  88   .07778793 .0642946 10.441468
    1 "3M IN Equity" 19692 646  89  -.00864305 .0489257 10.526425
    1 "3M IN Equity" 19723 647  90   .09171834 .0521581  10.52523
    1 "3M IN Equity" 19754 648  91 -.018433483 .0361629  10.62419
    1 "3M IN Equity" 19782 649  92   .01004472 .0850186  10.61317
    1 "3M IN Equity" 19813 650  93  -.04815184 .0424938 10.630838
    1 "3M IN Equity" 19843 651  94   .05474595 .0577024 10.590066
    1 "3M IN Equity" 19874 652  95   .15077305 .0492667  10.65219
    1 "3M IN Equity" 19904 653  96  .016436052 .0758469 10.810168
    1 "3M IN Equity" 19935 654  97    .0784366 .0584846  10.83374
    1 "3M IN Equity" 19966 655  98    .1795489 .0906183  10.91938
    1 "3M IN Equity" 19996 656  99   .05635969 .1083551   11.1061
    1 "3M IN Equity" 20027 657 100  -.02261045 .0654718 11.169559
    end
    format %td date
    format %tm mdate
    .
    On this data, i want to estimate Fama and Macbeth (1973) cross-sectional regressions using below code:

    Code:
    xtset stock_id time
    asreg rt idiovol size, fmb newey(5)
    The problem is that I want to amend this model so that it incorporates effects of global financial crisis or GFC07 and covid19 pandemic. Essentially, two time dummies for each cross-section are to be added for this purpose. The time-GFC and Covid19 is as below:

    GFC07: January 2008 to August 2009
    Covid-19: February 2020 onward till end of sample period, i.e. June 2022

    How to add these two time dummies (by stock_id), what will the code of the FM regressions be after adding dummies.
    Last edited by Sartaj Hussain; 04 Sep 2022, 13:01.

  • #2
    Essentially, two time dummies for each cross-section are to be added for this purpose. The time-GFC and Covid19 is as below:

    GFC07: January 2008 to August 2009
    Covid-19: February 2020 onward till end of sample period, i.e. June 2022
    Code:
    gen byte gfc07 = inrange(mdate, tm(2008m1), tm(2009m8))
    gen byte covid_19 = inrange(mdate, tm(2020m2), tm(2022m6))
    Note that because the dates for these intervals are the same for all firms, this does not have to be done by stock_id.

    what will the code of the FM regressions be after adding dummies
    I don't know. I do not use -asreg- myself and don't know how it works. And while I have heard of Fama Macbeth regression, I do not know what it is. I'm afraid this is outside my scope of knowledge. There are many on the Forum who are familiar with both -asreg- and Fama Macbeth regression. So hopefully one of them will join the thread.


    Comment

    Working...
    X