Announcement

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

  • Fama MacBeth model - factor loadings: asreg with fmb omits coefficients

    Dear all,

    I would like to get the loadings of various factors (i.e. their beta coefficients) influencing returns of a fund. My dependent variable is excess_ret_nr (return of a fund), and my explanatory variables are sp_logret size_spread_factor msci_logret bmf csf ptfsbd ptfsfx ptfscom (returns of various indices, bonds etc.).
    I have an unbalanced panel data with around 480'000 observations, 6200 units and time periods of length up to 228 months.

    I would like to use the asreg command with fmb option, preferably also with newey correction. However, when I use this, the coefficients and other statistics of my independent variables get omitted for some reason (see screenshot). I have tried to use various combinations of the code, but nothing seems to work, even if I use only one explanatory variable, the outcome is always the same (i.e. the constant value and its t-stat). The code I am trying to use is:

    Code:
    bysort id: asreg excess_ret_nr sp_logret size_spread_factor msci_logret bmf csf ptfsbd ptfsfx ptfscom , fmb

    I have also tried the xtfmb command, reportedly very similar to asreg, but its computation is very slow and still running for me currently.


    Can you please provide me with some advice on how to fix this? Thanks a lot!



    KC



    Click image for larger version

Name:	Omitted.PNG
Views:	1
Size:	251.4 KB
ID:	1488626

  • #2
    I have little experience with FMB, but I suspect your problem results from prefixing your command with bysort id:

    The Fama-MacBeth model depends on using cross-sectional data, but your prefix cause each id (which I assume is the fund identifier you have used to xtset your data) to be treated separately, so there is no ability to estimate the cross-sectional component. The examples shown in the output of help asreg (examples 12-15) and help xtfmb do not use the prefix. For what reason do you feel your problem is different and requires the prefix?
    Last edited by William Lisowski; 17 Mar 2019, 10:01.

    Comment


    • #3
      Dear William, thank you for your reply. However, the command without the bysort option results in exactly the same outcome as with it, unfortunately.

      I suspect the problem may be in the fact that all of my independent variables are various indices or interest rate levels, and therefore they are the same in the cross-sectional dimension (e.g. the value sp_logret is the same for all IDs in time 1, then takes a different value in time 2, but this value is again the same for all IDs). Nevertheless, I would say this problem has to arise naturally in case of Fama-French (also CAPM etc.) model, and I thought it will be alright with the 2-step FMB regression?

      Comment


      • #4
        So try running asreg without the bysort prefix and adding the first option. My expectation is that you are going to see a series of first-stage regression results with very poor results, which would strongly suggest that your understanding of and expectations for FMB modeling are incorrect.

        Here is a made-up example that yields poor results similar to yours.
        Code:
        . * use reaslistic data
        . webuse grunfeld, clear
        
        . drop if year<1940
        (50 observations deleted)
        
        . asreg invest mvalue kstock, fmb first
        First stage Fama-McBeth regression results
        
              +------------------------------------------------------------+
              | _TimeVar   _obs       _R2   _b_mva~e   _b_kst~k      _Cons |
              |------------------------------------------------------------|
              |     1940     10   .839255    .095399    .202291   -27.0471 |
              |     1941     10   .856215    .114764    .177465   -16.5195 |
              |     1942     10   .857307    .142825    .071024   -17.6183 |
              |     1943     10   .842064     .11861    .105412   -22.7638 |
              |     1944     10   .875515    .118164    .072207   -15.8281 |
              |     1945     10   .906797    .108471    .050221   -10.5197 |
              |     1946     10   .894752    .137948    .005413   -5.99066 |
              |     1947     10   .891239    .163927   -.003707   -3.73249 |
              |     1948     10   .788823    .178667   -.042556    8.53881 |
              |     1949     10   .863257    .161596   -.036965    5.17829 |
              |     1950     10   .857714    .176217   -.022096   -12.1747 |
              |     1951     10   .873773    .183141   -.112057    26.1382 |
              |     1952     10   .846122    .198921   -.067495    7.29284 |
              |     1953     10   .889261    .182674    .098753   -50.1525 |
              |     1954     10    .89845    .134512    .331375   -133.393 |
              |------------------------------------------------------------|
         Mean |     1947     10    .86537    .147722    .055286   -17.9061 |
              +------------------------------------------------------------+
        
        Fama-MacBeth (1973) Two-Step procedure           Number of obs     =       150
                                                         Num. time periods =        15
                                                         F(  2,    14)     =    315.76
                                                         Prob > F          =    0.0000
                                                         avg. R-squared    =    0.8654
        ------------------------------------------------------------------------------
                     |            Fama-MacBeth
              invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              mvalue |   .1477223   .0083671    17.66   0.000     .1297766     .165668
              kstock |   .0552857   .0301458     1.83   0.088    -.0093707    .1199421
               _cons |  -17.90612   9.443551    -1.90   0.079    -38.16052    2.348281
        ------------------------------------------------------------------------------
        
        . * replace data so independent variables are constant across firms
        . bysort year (company): replace mvalue = mvalue[1]
        (135 real changes made)
        
        . bysort year (company): replace kstock = kstock[1]
        (135 real changes made)
        
        . asreg invest mvalue kstock, fmb first
        First stage Fama-McBeth regression results
        
              +---------------------------------------------------------+
              | _TimeVar   _obs       _R2   _b_mva~e   _b_kst~k   _Cons |
              |---------------------------------------------------------|
              |     1940     10   8.7e-33     .02439          0       0 |
              |     1941     10         0    .030699          0       0 |
              |     1942     10   7.6e-33    .037812          0       0 |
              |     1943     10         0    .029057          0       0 |
              |     1944     10         0    .027613          0       0 |
              |     1945     10         0    .025648          0       0 |
              |     1946     10         0    .032924          0       0 |
              |     1947     10         0    .041723          0       0 |
              |     1948     10         0      .0473          0       0 |
              |     1949     10         0    .037631          0       0 |
              |     1950     10   2.1e-32    .040223          0       0 |
              |     1951     10         0    .041296          0       0 |
              |     1952     10   1.0e-32     .04549          0       0 |
              |     1953     10         0    .044152          0       0 |
              |     1954     10         0    .048945          0       0 |
              |---------------------------------------------------------|
         Mean |     1947     10   3.1e-33    .036994          0       0 |
              +---------------------------------------------------------+
        
        Fama-MacBeth (1973) Two-Step procedure           Number of obs     =       150
                                                         Num. time periods =        15
                                                         F(  2,    14)     =    312.51
                                                         Prob > F          =    0.0000
                                                         avg. R-squared    =    0.0000
        ------------------------------------------------------------------------------
                     |            Fama-MacBeth
              invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              mvalue |   .0369936   .0020926    17.68   0.000     .0325054    .0414818
              kstock |          0  (omitted)
               _cons |          0  (omitted)
        ------------------------------------------------------------------------------
        
        .
        Added in edit: You can see that within each year a cross-sectional model is fit. But the independent variables are identical for each firm, so they are all collinear with each other and with the constant.
        Last edited by William Lisowski; 17 Mar 2019, 11:00.

        Comment


        • #5
          I see what you mean, thank you. The fact that factors are constant in the cross-section indeed causes trouble here.

          What I do not understand completely is that the factors should by invariant in the cross-section quite often (CAPM, more factor models etc.). Therefore, I thought this in-built command will work. However, it seems to me that I have at first manually for each fund regress return on factors (everything varies during the time series and I obtain n sets of betas), and then use these n sets of betas as independent variables for cross-section of fund returns in each period T (again, nothing is constant). I obtain T sets of gammas (coefficients of betas), which I then take average of. But this is the very definition of FMB if I am not mistaken. Thank you.

          Comment


          • #6
            Hey Kuba, did you manage to get around this issue? I also have it

            Comment


            • #7
              Hello guys, I see that this problem is over a year old, probably someone have got an answer by now, Because am currently facing the same issue. there are just 2 variables that it omits in mine, outside those two , the model ran very fine. here is a sample of my code
              Code:
               xtfmb s_rets DSIN GSTI DSIN_GSTI beta logGDP inf Trade rel IND UAI Law
              after the data have been properly tsset

              a sample of the result
              Code:
              Fama-MacBeth (1973) Two-Step procedure           Number of obs     =     96006
                                                               Num. time periods =        72
                                                               F( 11,    71)     =      6.13
                                                               Prob > F          =    0.0000
                                                               avg. R-squared    =    0.0844
              ------------------------------------------------------------------------------
                           |            Fama-MacBeth
                    s_rets |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      DSIN |   .0002673   .0201758     0.01   0.989    -.0399621    .0404966
                      GSTI |  -.0305214   .0286785    -1.06   0.291    -.0877047    .0266618
                 DSIN_GSTI |   .0016191   .0266431     0.06   0.952    -.0515058     .054744
                      beta |  -.0042751   .0082491    -0.52   0.606    -.0207234    .0121731
                    logGDP |   .0893524   .0343091     2.60   0.011     .0209419    .1577628
                       inf |          0  (omitted)
                     Trade |   .0010355    .000293     3.53   0.001     .0004514    .0016196
                       rel |   -.047473   .0245492    -1.93   0.057    -.0964228    .0014768
                       IND |   .0012485   .0005488     2.28   0.026     .0001543    .0023428
                       UAI |   .0007867   .0003699     2.13   0.037     .0000492    .0015242
                       Law |          0  (omitted)
                     _cons |  -.5737374   .1436543    -3.99   0.000     -.860176   -.2872987
              ------------------------------------------------------------------------------
              when I used verbose to obtain betas for the first stage it was zeros for variable inf and law. I could seriously use the help here.
              Thank you

              and a sample of the data
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input float(s_rets DSIN) double(inf Law logGDP)
               -.09305654 0 81.26 .69  4.513301979323348
              -.017718805 0 81.54 .69  4.489399622670815
                .04053328 0 82.05 .69  4.489399622670815
                -.0802488 0 82.41 .69  4.489399622670815
                .00924442 0 82.61 .69  4.489399622670815
               .017505413 0 82.69 .69  4.489399622670815
                .02555083 0 82.65 .69  4.489399622670815
               .012146305 0 82.84 .69  4.489399622670815
               -.11463328 0 83.21 .69  4.489399622670815
                .08726874 0 83.43 .69  4.489399622670815
              -.017968804 0  83.3 .69  4.489399622670815
               -.02954207 0 83.54 .69  4.489399622670815
               -.09176592 0 83.24 .69  4.489399622670815
              -.020283194 0 83.49 .69   4.55526010094358
               -.02217796 0 83.88 .69   4.55526010094358
               -.06764616 0 84.42 .69   4.55526010094358
                -.0634919 0 84.72 .69   4.55526010094358
              -.015827473 0 84.81 .69   4.55526010094358
               -.11494969 0 84.72 .69   4.55526010094358
               -.09544882 0 84.86 .69   4.55526010094358
                .05052771 0  84.9 .69   4.55526010094358
              -.067081206 0 84.97 .69   4.55526010094358
                   -.0401 0 85.06 .69   4.55526010094358
                .01096042 0 85.39 .69   4.55526010094358
               -.09230352 0 85.02 .69   4.55526010094358
                .06244153 0 85.29 .69 4.5146901948850795
                -.1772629 0 85.81 .69 4.5146901948850795
               -.10484731 0  86.3 .69 4.5146901948850795
              -.031960476 0 86.53 .69 4.5146901948850795
              -.068035536 0 86.64 .69 4.5146901948850795
                -.1142455 0 86.41 .69 4.5146901948850795
               -.03957799 0 86.52 .69 4.5146901948850795
               -.13867562 0 86.84 .69 4.5146901948850795
               -.11705454 0 87.28 .69 4.5146901948850795
               -.21336083 0 87.74 .69 4.5146901948850795
                -.2430301 0  88.1 .69 4.5146901948850795
               -.06860016 0 87.92 .69 4.5146901948850795
                .07875106 0 88.29 .69  4.467990831299838
               -.28362384 0 89.03 .69  4.467990831299838
                -.1666604 0  89.4 .69  4.467990831299838
               -.03333697 0 89.97 .69  4.467990831299838
                -.1456044 0 90.34 .69  4.467990831299838
                -.4073372 0 90.27 .69  4.467990831299838
               -.14489168 0 90.24 .69  4.467990831299838
               -.17231816 0 90.48 .69  4.467990831299838
                -.0395976 0 90.51 .69  4.467990831299838
               -.20926444 0 90.17 .69  4.467990831299838
                -.1304232 0 90.01 .69  4.467990831299838
               -.08579337 0 89.47 .69  4.467990831299838
               -.12066036 0 89.93 .69  4.475321051539448
                -.1023769 0 90.25 .69  4.475321051539448
                .09577476 0 90.56 .69  4.475321051539448
                .21496865 0 90.72 .69  4.475321051539448
                .09648463 0 90.91 .69  4.475321051539448
                 -.150746 0 90.49 .69  4.475321051539448
               .006052863 0 90.75 .69  4.475321051539448
                .05538186 0 90.77 .69  4.475321051539448
                -.1432109 0 90.96 .69  4.475321051539448
                -.0919793 0 91.11 .69  4.475321051539448
                   -.0374 0 91.39 .69  4.475321051539448
               -.08925284 0 90.95 .69  4.475321051539448
              -.031297598 0 91.24 .69     4.467196278598
                -.0844327 0 92.07 .69     4.467196278598
                .13277294 0 92.47 .69     4.467196278598
                -.0709134 0  92.6 .69     4.467196278598
               -.07794343 0 92.64 .69     4.467196278598
               -.10263007 0 92.38 .69     4.467196278598
              -.023334336 0 92.56 .69     4.467196278598
               -.19751956 0 92.81 .69     4.467196278598
               -.09008024 0 93.08 .69     4.467196278598
                 .1108121 0 93.23 .69     4.467196278598
               -.08464652 0 93.82 .69     4.467196278598
                .09518176 0 81.26 .69  4.513301979323348
                .08952478 0 81.54 .69  4.489399622670815
               -.26972455 0 82.05 .69  4.489399622670815
                 .2188439 0 82.41 .69  4.489399622670815
                .04718369 0 82.61 .69  4.489399622670815
               -.07318299 0 82.69 .69  4.489399622670815
                -.1950928 0 82.65 .69  4.489399622670815
                 .2478401 0 82.84 .69  4.489399622670815
                -.3195623 0 83.21 .69  4.489399622670815
               -.01011929 0 83.43 .69  4.489399622670815
                .05029448 0  83.3 .69  4.489399622670815
               .062529646 0 83.54 .69  4.489399622670815
               .016662722 0 83.24 .69  4.489399622670815
              -.025795616 0 83.49 .69   4.55526010094358
                .06802222 0 83.88 .69   4.55526010094358
                -.1770724 0 84.42 .69   4.55526010094358
                 .2374624 0 84.72 .69   4.55526010094358
               -.26144913 0 84.81 .69   4.55526010094358
                .22478144 0 84.72 .69   4.55526010094358
                -.1612536 0 84.86 .69   4.55526010094358
               -.16929813 0  84.9 .69   4.55526010094358
                 .2424401 0 84.97 .69   4.55526010094358
                 .0816472 0 85.06 .69   4.55526010094358
                -.1382488 0 85.39 .69   4.55526010094358
               -.18847957 0 85.02 .69   4.55526010094358
                .05649259 0 85.29 .69 4.5146901948850795
               -.11964843 0 85.81 .69 4.5146901948850795
               -.12852699 0  86.3 .69 4.5146901948850795
              end

              Comment

              Working...
              X