Announcement

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

  • Time-fixed effects regression when there is already time-variant independent variable

    For my research, I am using the following model, which tries to determine whether economic uncertainty (as measured by some proxies) influences fund inflows and outflows:

    Netfundflowsi,t (i.e. money inflows or outflows) = β1 + β2*economicuncertaintyi,t + β3laggedfundreturni,t + β4fundagei,t + β5fundsizei,t + β6fundriski,t + β6expenseratioi,t + error termi,t

    My question is: can I use time-fixed effects?
    The reason for my doubt is that I already have economic uncertainty as an independent variable in the model, which is already a factor that affects ALL funds (and is not fund specific), changing for every time period. What I would think is that when using a time-fixed effects model, this will mess up the slope coefficient of the economic uncertainty variable.

    Thanks in advance, Jaap
    Last edited by Jaap van Duivenboden; 25 May 2022, 02:49.

  • #2
    Jaap:
    welcome to this forum.
    1) you can add -i.time-; at worst, its inclusion will cause some perfect collinearity issues, that you can manage removing one of the culprit variables;
    2) I would search for a possible turning point, that is a quadratic relationship between the regressand and -fundage-. Just type:
    Code:
    c.fundage##c.fundage
    to include both the linear and the squared terms in the right-hand side of your regression equation.
    3) you do not give any detail about what follows, but you might have a panel dataset with a continuous regressand. If this is the case, what above still holds, but your first tool should be -xtreg,fe- instead of -regress-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank Carlo for your quick response. I think you may have misunderstood my question. I am not worried about fundage in combination with time fixed effects. Instead, I am worried about economic uncertainty in combination with time fixed effects. Economic uncertainty here is a continuous variable and is no different for any of the funds. It only varies per month, not per fund.

      For a better overview of how (monthly) time fixed effects influence my regression results, I will show you what my different regression results look like.

      The first screenshot shows the regression without time fixed effects. Here, the coefficient for economic uncertainty (OverallEPU) is negative, which is what I expect according to the academic literature. It means that the higher the economic uncertainty (OverallEPU) is during a month in the U.S., the less money will be invested into a fund by investors (regressand).




      On the next screenshot beneath, the regression results of the same regression but now including monthly time fixed effects are shown. As visible, most of the coefficients have remained pretty similar in magnitude and sign. However, the coefficient for economic uncertainty (OverallEPU) has changed drastically, now being positive instead of negative. Which is wrong according to what the literature says. I assume that this has to do with the time-fixed effects heavily correlating with economic uncertainty. Is this a problem that can be solved? Do you happen to know what is going on here?





      Kind regards,
      Jaap
      MSc. student Finance & Investments

      Comment


      • #4
        Jaap:
        (mis)understanding original poster's query is conditional on her/his description of what she/he's experiencing and the support she/he provides potentially interested listers with in term of sharing what she/he typed and what Stata gave her/him back, possibly along with an example/excerpt of her/his dataset (to be shared via -dataex-). All these recommendations are well reported in the FAQ, that first-time posters are assumed to read before becoming active members of this forum.
        In addition, a thorough consistency check (along the lines of "Was my question clear enough and in line with the provided details") is highly advisable.
        That said:
        1) your screenshots (discouraged, as per FAQ again) are unreadable;
        2) you do not say (and I cannot figure out) whether the coefficient that flips sign is (ir not) different from zero. As you surmised, time has probably a role (and this evidence may support its inclusion in the right-hand side of your regression equation). Due to the lack of other details, I cannot suggest any fix.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo.
          Sorry for my previous post. I appreciate your effort very much and have now read the FAQ. Hopefully, this post is better (trying to improve every time).

          Beneath is an example of my dataset.
          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input: PercentageFundFlow / D_SRI / EconomicUncertainty / fundreturn_lagged / currentage / ln_fundsize / Beta_market / fundexpenseratio
             -.7533572 1 125.92369842529297    4.67179  6.412046 17.656374 1.3493474479744005        1
             -.4335318 1 142.30938339233398     .69647  6.502396 17.695353 1.0221564985355125        1
             -.5019441 1  104.3814926147461    4.40835  6.579055 17.647541 1.0469962500964634        1
              -.866004 1 161.71509552001953   -4.16667  6.658453  17.63474  .9196796871223281        1
            -.16027407 1 123.62455368041992     -.4058  6.746064 17.630219  .9279050596631218        1
             .11512205 1  143.6066665649414    -.29104  6.830938 17.646416  .9060547117539473        1
              4.502386 1 121.51508331298828    1.51781  6.910336 17.703575   .899600321366993        1
             .51049024 1  154.6456756591797     1.3801  6.997947 17.744148   .937013745959486        1
             1.2764426 1 107.04850006103516    3.63018   7.08282 17.785072  .8971125245608438 .9999999
            -.05918901 1 111.82269668579102    2.90093   7.15948 17.791376   .876858907014469        1
            -1.1742235 1 123.81360626220703     .69149  7.249829 17.708117  .8962092833983936        1
             .02721862 1  147.5830307006836   -6.81458  7.331964 17.746202  .8821983370139469 .9999999
             -.8383315 1 196.43184661865234    3.85488  7.416838 17.639668   .931002105683804        1
               .600061 1  242.5839614868164  -8.628289  7.501711  17.71947  .9387080899966581        1
              .1625025 1 115.26996994018555    7.70713  7.578371 17.770456  .9417659108606214        1
             -4.888323 1  160.4395294189453    5.06857  7.657769 17.721594  .9556468552213718        1
              .8183095 1 104.21152877807617     .85131   7.74538 17.770218  .9535634523525589        1
              2.301904 1 141.69845962524414    4.16432  7.830253  17.73369  .9584823220928265        1
             1.7959925 1  179.0540771484375   -5.88871  7.906913 17.818027  .9551986784442464        1
              .2828125 1 178.85918426513672    7.00344  7.997262 17.828312   .952797882483383        1
             4.3110685 1 236.49309539794922     .75107  8.079397 17.843092  .9660696675714462        1
              .7176303 1  160.5012435913086   -2.82215  8.164271  17.88131  .9711033115382562        1
             .50287926 1 138.99980926513672    3.17808  8.249145 17.893171  .9671508808839697        1
             1.0088342 1  151.1155242919922     .69039  8.328542  17.93507  .9563580808535163        1
             -.7009878 1 166.98607635498047    3.27004  8.416153 17.948874  .9335062893724158        1
              .3923316 1  148.0732192993164    2.09085  8.501027  17.93723  .9693444784571803        1
             -.5107583 1 188.35342407226563   -1.54997  8.577686 17.838957  .9831689450835122        1
              4.971789 1  354.4632110595703  -8.628289 8.6652975 17.774578 1.0470575958705757        1
              3.886357 1  334.7805633544922  -8.628289  8.747434 17.914997   .982132332887291        1
              .4243851 1  427.2115936279297   9.384215  8.826831 17.971416 1.0091636729564135        1
             2.2275941 1 265.74996185302734    5.37975  8.914442 17.994621  .9956577518273918 .9999999
             .09113062 1 366.93943786621094     .12012  8.999315 18.042938  .9965456658263981        1
             1.0196595 1  243.9488983154297    4.85903  9.084188 18.083204  .9651757374663725        1
            -1.1534483 1 235.32305145263672    3.08924  9.166325 18.049465  .9419006738904248        1
             -.4800019 1  277.4701232910156   -2.16426   9.24846  18.05147  .9197542233545275        1
          end
          Here are the regression results of the model without time fixed effects
          Code:
          . reg PercentageFundFlow i.D_SRI##c.EconomicUncertainty fundreturn_lag currentage ln_fundsize Beta_market fundexpenseratio
          
                Source |       SS           df       MS      Number of obs   =    12,737
          -------------+----------------------------------   F(8, 12728)     =    134.52
                 Model |  5563.49897         8  695.437372   Prob > F        =    0.0000
              Residual |  65799.9175    12,728  5.16969811   R-squared       =    0.0780
          -------------+----------------------------------   Adj R-squared   =    0.0774
                 Total |  71363.4165    12,736  5.60328333   Root MSE        =    2.2737
          
          ---------------------------------------------------------------------------------------------
                   PercentageFundFlow | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          ----------------------------+----------------------------------------------------------------
                              1.D_SRI |   .0042876   .1098719     0.04   0.969    -.2110778     .219653
                  EconomicUncertainty |  -.0028308   .0003976    -7.12   0.000    -.0036101   -.0020516
                                      |
          D_SRI#c.EconomicUncertainty |
                                   1  |   .0029946   .0005558     5.39   0.000     .0019052    .0040841
                                      |
                       fundreturn_lag |   .0168664   .0038195     4.42   0.000     .0093795    .0243533
                           currentage |  -.0467628   .0023411   -19.97   0.000    -.0513517   -.0421739
                          ln_fundsize |   .0177135   .0133943     1.32   0.186    -.0085414    .0439685
                          Beta_market |  -.2245139   .0908194    -2.47   0.013    -.4025335   -.0464943
                     fundexpenseratio |  -.9473313   .0558081   -16.97   0.000    -1.056724   -.8379391
                                _cons |    1.73473   .2905568     5.97   0.000     1.165195    2.304265
          ---------------------------------------------------------------------------------------------

          And here are my regression results including monthly time fixed effects. As visible, the coefficient for economic uncertainty changed drastically. Does this give you a better view on the problem? Is it indeed true that combining monthly economic uncertainty and monthly time-fixed effects is problematic? If so, do you know why exactly? Important to realize is that all independent variables are continuous and fund-specific, whereas economic uncertainty is continuous and not fund-specific, which I think can be problematic when including time-fixed effects.
          Code:
          . reg PercentageFundFlow i.D_SRI##c.EconomicUncertainty fundreturn_lag currentage ln_fundsize Beta_market fundexpenseratio i.date
          note: 202202.date omitted because of collinearity.
          
                Source |       SS           df       MS      Number of obs   =    12,737
          -------------+----------------------------------   F(57, 12679)    =     25.26
                 Model |  7277.31531        57  127.672198   Prob > F        =    0.0000
              Residual |  64086.1012    12,679  5.05450755   R-squared       =    0.1020
          -------------+----------------------------------   Adj R-squared   =    0.0979
                 Total |  71363.4165    12,736  5.60328333   Root MSE        =    2.2482
          
          ---------------------------------------------------------------------------------------------
                   PercentageFundFlow | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          ----------------------------+----------------------------------------------------------------
                              1.D_SRI |   .0199941   .1086616     0.18   0.854     -.192999    .2329872
                  EconomicUncertainty |   .1100188   .0174019     6.32   0.000     .0759084    .1441293
                                      |
          D_SRI#c.EconomicUncertainty |
                                   1  |   .0028661   .0005498     5.21   0.000     .0017884    .0039438
                                      |
                       fundreturn_lag |   .0881138   .0091328     9.65   0.000     .0702121    .1060155
                           currentage |  -.0488826   .0023307   -20.97   0.000     -.053451   -.0443141
                          ln_fundsize |   .0046753    .013313     0.35   0.725    -.0214202    .0307708
                          Beta_market |  -.2729692   .0926073    -2.95   0.003    -.4544935   -.0914449
                     fundexpenseratio |  -.9562554   .0551991   -17.32   0.000    -1.064454   -.8480568
                                      |
                                 date |
                              201801  |  -.7525017   .2577149    -2.92   0.004    -1.257662   -.2473415
                              201802  |   2.637427   .4976641     5.30   0.000     1.661931    3.612924
                              201803  |  -2.940301   .5354485    -5.49   0.000    -3.989862   -1.890741
                              201804  |   1.000446   .2278446     4.39   0.000      .553836    1.447056
                              201805  |  -1.270214    .270475    -4.70   0.000    -1.800386   -.7400424
                              201806  |   .6430263   .2485493     2.59   0.010      .155832    1.130221
                              201807  |  -2.654209   .4324728    -6.14   0.000    -3.501921   -1.806497
                              201808  |   2.531524   .4584181     5.52   0.000     1.632955    3.430093
                              201809  |   1.892558    .384791     4.92   0.000      1.13831    2.646807
                              201810  |   .8420799   .2252875     3.74   0.000     .4004824    1.283677
                              201811  |  -1.651549    .305715    -5.40   0.000    -2.250796   -1.052301
                              201812  |  -8.658699   1.144333    -7.57   0.000    -10.90176   -6.415634
                              201901  |  -11.53128   1.907376    -6.05   0.000    -15.27002   -7.792534
                              201902  |    1.14374   .3264344     3.50   0.000     .5038794    1.783601
                              201903  |  -3.626939   .5391304    -6.73   0.000    -4.683716   -2.570162
                              201904  |   3.108104   .5097805     6.10   0.000     2.108857    4.107351
                              201905  |   -1.50292   .2574042    -5.84   0.000    -2.007472   -.9983694
                              201906  |  -4.984567   .8203739    -6.08   0.000    -6.592623    -3.37651
                              201907  |  -5.884506   .8595438    -6.85   0.000    -7.569341    -4.19967
                              201908  |  -11.89887   1.829658    -6.50   0.000    -15.48528   -8.312464
                              201909  |  -3.079362   .5206971    -5.91   0.000    -4.100007   -2.058717
                              201910  |  -1.134571   .2196474    -5.17   0.000    -1.565113   -.7040288
                              201911  |  -2.422625   .3859551    -6.28   0.000    -3.179155   -1.666095
                              201912  |  -4.460777   .6462513    -6.90   0.000    -5.727527   -3.194027
                              202001  |  -2.154479   .3426834    -6.29   0.000     -2.82619   -1.482768
                              202002  |   -6.32578   .9942721    -6.36   0.000    -8.274703   -4.376856
                              202003  |  -24.66575   3.850392    -6.41   0.000     -32.2131    -17.1184
                              202004  |  -21.25359    3.48421    -6.10   0.000    -28.08317   -14.42401
                              202005  |  -34.23929   5.178203    -6.61   0.000    -44.38935   -24.08923
                              202006  |  -15.76062    2.35323    -6.70   0.000    -20.37331   -11.14793
                              202007  |  -26.88018   4.101545    -6.55   0.000    -34.91982   -18.84053
                              202008  |  -13.23965   1.974714    -6.70   0.000    -17.11038    -9.36891
                              202009  |  -12.05897   1.826101    -6.60   0.000     -15.6384   -8.479537
                              202010  |  -16.25032   2.530074    -6.42   0.000    -21.20964   -11.29099
                              202011  |  -16.95005   2.702154    -6.27   0.000    -22.24668   -11.65342
                              202012  |  -18.41092   2.735926    -6.73   0.000    -23.77375   -13.04809
                              202101  |  -11.66429   1.813354    -6.43   0.000    -15.21874   -8.109847
                              202102  |  -3.638582    .679787    -5.35   0.000    -4.971067   -2.306096
                              202103  |  -2.047582   .4244283    -4.82   0.000    -2.879526   -1.215638
                              202104  |   .1420766   .1812379     0.78   0.433    -.2131772    .4973303
                              202105  |  -3.007566    .528278    -5.69   0.000    -4.043071   -1.972061
                              202106  |  -.8931593   .2440903    -3.66   0.000    -1.371613   -.4147054
                              202107  |  -3.837025    .649161    -5.91   0.000    -5.109478   -2.564571
                              202108  |  -1.237028   .2983058    -4.15   0.000    -1.821753    -.652304
                              202109  |   -2.75659   .4740852    -5.81   0.000    -3.685869   -1.827311
                              202110  |   .9775299   .1853058     5.28   0.000     .6143025    1.340757
                              202111  |  -3.786594   .5975744    -6.34   0.000     -4.95793   -2.615258
                              202112  |  -6.063051   .9107991    -6.66   0.000    -7.848355   -4.277747
                              202201  |  -1.733473   .3335581    -5.20   0.000    -2.387297   -1.079649
                              202202  |          0  (omitted)
                                      |
                                _cons |  -12.83282   2.297384    -5.59   0.000    -17.33604     -8.3296
          ---------------------------------------------------------------------------------------------
          Thanks in advance, Jaap
          Last edited by Jaap van Duivenboden; 31 May 2022, 02:09.

          Comment


          • #6
            Jaap:
            as per your excerpt/example, your second regression cannot be run due to a missing -i.date- predictor.
            Please also note that, as per -input- helpfile, no slash is needed between variables.
            That said:
            1) as per your second code, it seems that economomic uncertainty is time-related/driven; therefore, if you include -i.time- too, the result is bewildering vs the theory.
            2) a different take may imply to include time as a continuous variable, with both linear and squared terms, and search for a turning point (if the relationship between regressand and -c.time- is actually non-linear):
            Code:
            c.time##c.time
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Dear Carlo,

              I believe I have found a better alternative for the time-fixed effects in the meantime. You are indeed right that:
              economomic uncertainty is time-related/driven; therefore, if you include -i.time- too, the result is bewildering vs the theory.
              Instead of using i.date (where dates are ranging from 201712 up to and including 202201), I now generated a variable for the month of the year. When including this month of the year time fixed effects (i.month). I get much more realistic results, as it does not mess with the economic uncertainty coefficients as much.

              See the results below:
              Code:
              . reg PercFlow_fund_w i.D_SRI##c.EconomicUncertainty fundreturn_lag_w currentage ln_TNA_fund Beta_market fundexpenser
              > atio i.year
              
                    Source |       SS           df       MS      Number of obs   =    12,737
              -------------+----------------------------------   F(13, 12723)    =     83.74
                     Model |  5607.00786        13  431.308297   Prob > F        =    0.0000
                  Residual |  65529.4167    12,723  5.15046897   R-squared       =    0.0788
              -------------+----------------------------------   Adj R-squared   =    0.0779
                     Total |  71136.4246    12,736  5.58546047   Root MSE        =    2.2695
              
              ---------------------------------------------------------------------------------------------
                          PercFlow_fund_w | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
              ----------------------------+----------------------------------------------------------------
                                  1.D_SRI |   .1422555   .1098195     1.30   0.195    -.0730072    .3575182
                      EconomicUncertainty |  -.0025275   .0005339    -4.73   0.000     -.003574   -.0014809
                                          |
              D_SRI#c.EconomicUncertainty |
                                       1  |   .0025307   .0005554     4.56   0.000      .001442    .0036194
                                          |
                         fundreturn_lag_w |   .0122595   .0045465     2.70   0.007     .0033476    .0211714
                               currentage |  -.0401073   .0025669   -15.62   0.000    -.0451388   -.0350759
                              ln_TNA_fund |  -.0725794   .0137564    -5.28   0.000     -.099544   -.0456149
                              Beta_market |  -.5043068    .085286    -5.91   0.000    -.6714802   -.3371334
                         fundexpenseratio |  -1.047828   .0527989   -19.85   0.000    -1.151322   -.9443346
                                          |
                                     year |
                                    2018  |   .2742895    .150859     1.82   0.069    -.0214168    .5699959
                                    2019  |   .3452911   .1520061     2.27   0.023     .0473362    .6432459
                                    2020  |   .4286409   .1672996     2.56   0.010     .1007085    .7565732
                                    2021  |   .6515545   .1519782     4.29   0.000     .3536544    .9494546
                                    2022  |   .6960152   .1781323     3.91   0.000     .3468491    1.045181
                                          |
                                    _cons |    3.19267   .3287769     9.71   0.000     2.548218    3.837122
              ---------------------------------------------------------------------------------------------
              Now, the coefficients for economic uncertainty are very similar to those without fixed effects. Only the explanatory power of the model increased and there is less of an omitted variable bias, as was my goal!

              Comment


              • #8
                Jaap:
                that's great, but:
                1) are you really dealing with a cross-sectional dataset with 12,737 unrepeated units across time? Are you sure that it is not a panel dataset?
                2) whatever the reply to point 1), it is really weird that default standard errors are Ok there (no heteroskedasticity? no serial correlation of the epsilon?);
                3) residuals still have a relevant role in your regression (as you can see from the low R-sq). I would try -linktest- as a postestimation command to investigate whether the functional form of teh regressand is correctly specified.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Dear Carlo,

                  To answer your question:
                  1) This is indeed a panel dataset, with observations of different funds in different months
                  3) performing the -linktest- command yields the following results:

                  Code:
                  . linktest
                  
                        Source |       SS           df       MS      Number of obs   =    12,737
                  -------------+----------------------------------   F(2, 12734)     =    620.82
                         Model |   6320.0242         2   3160.0121   Prob > F        =    0.0000
                      Residual |  64816.4004    12,734  5.09002673   R-squared       =    0.0888
                  -------------+----------------------------------   Adj R-squared   =    0.0887
                         Total |  71136.4246    12,736  5.58546047   Root MSE        =    2.2561
                  
                  ------------------------------------------------------------------------------
                  PercFlow~d_w | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  -------------+----------------------------------------------------------------
                          _hat |   1.016292   .0301611    33.70   0.000     .9571721    1.075413
                        _hatsq |   .3533255   .0298528    11.84   0.000     .2948095    .4118415
                         _cons |  -.1671785    .024947    -6.70   0.000    -.2160785   -.1182786
                  ------------------------------------------------------------------------------

                  Comment


                  • #10
                    Jaap:
                    1) to be a panel dataset, you should have the same sample (more or less, due to panel attrition) mesured on the very same set of variables at (ideally) equally spaced time intervals;
                    2) the -linktest- tells you that your (to be revised as per 1)) -regress- is misspecified (ie, needs more predictors an/or interactions and/or logging the regressand).
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment

                    Working...
                    X