Announcement

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

  • Mundlak approach for the time dimension (i.e. considering years as first-level unit)

    Hi all!

    I'm trying to show that the year-fixed effects which were interpreted in some papers as a quite unrealistic behaviour, are actually driven by time variation in other company-specific variables and / or macroeconomic factors. Therefore, this would be one very specific situation where I am interested to estimate the higher-level variation in cross-section-invariant factors (such as GDP for example, which would affect equally all companies in a given year, ceteris paribus).
    This is how i discovered the Mundlak model, which has been used for estimating time-invarying factors so far.
    I'm pretty bad with the technicalities so i wouldn't be able to follow and understand the mathematic steps of the estimation, so i (perhaps stupidly?) assumed that I could do the same for the time dimension and get an equivalent model to one using time-fixed effects. Hence I calculated the yearly means for my company-specific variables and figured that I could use i(year) to get a period RE estimation (which i'm not sure it's the correct way to write it).
    When i compare the models, however, I don't get the same coefficients (and SE), and my question is..why? I would really appreciate any input on this, since many hours of googling couldn't get me any example on the time dimension (or I have no idea what to look for..)
    It also looks like with one variable the results are almost identical, but they become more different the more variables I add, so perhaps it is really an estimation issue. However, with my limited technical knowledge I have hard times understanding why Mundlak would only work in cross-section but not in time..


    So here's the output (i only picked two variables just to make it as simple as possible):

    year FE ( I have no idea how to use xtreg in this context, since just writing xtreg with i.year would automatically add company random effects, right?):

    Code:
    . reg rating capex_w lev_w i.year
    
          Source |       SS           df       MS      Number of obs   =    26,561
    -------------+----------------------------------   F(35, 26525)    =    296.59
           Model |  101874.948        35  2910.71279   Prob > F        =    0.0000
        Residual |  260310.482    26,525  9.81377877   R-squared       =    0.2813
    -------------+----------------------------------   Adj R-squared   =    0.2803
           Total |   362185.43    26,560  13.6364996   Root MSE        =    3.1327
    
    ------------------------------------------------------------------------------
          rating |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         capex_w |  -.0035686   .3275162    -0.01   0.991    -.6455179    .6383807
           lev_w |   9.213182   .0955961    96.38   0.000     9.025808    9.400555
                 |
            year |
           1984  |  -3.211079   3.836789    -0.84   0.403    -10.73139    4.309233
           1985  |  -2.722106    3.13585    -0.87   0.385    -8.868539    3.424328
           1986  |  -2.176657   3.135453    -0.69   0.488    -8.322313    3.968999
           1987  |  -2.184854   3.135357    -0.70   0.486    -8.330321    3.960613
           1988  |  -2.568382   3.135455    -0.82   0.413    -8.714041    3.577277
           1989  |  -2.858261   3.135588    -0.91   0.362    -9.004181    3.287658
           1990  |  -3.012191   3.135746    -0.96   0.337     -9.15842    3.134038
           1991  |  -3.031841   3.135674    -0.97   0.334    -9.177929    3.114248
           1992  |  -2.901572   3.135491    -0.93   0.355    -9.047302    3.244159
           1993  |  -2.679974   3.135191    -0.85   0.393    -8.825115    3.465168
           1994  |  -2.566824    3.13508    -0.82   0.413    -8.711748    3.578099
           1995  |  -2.526583   3.134879    -0.81   0.420    -8.671114    3.617948
           1996  |  -2.403677   3.134599    -0.77   0.443    -8.547659    3.740305
           1997  |  -2.347413   3.134418    -0.75   0.454    -8.491039    3.796214
           1998  |  -2.462711   3.134271    -0.79   0.432     -8.60605    3.680628
           1999  |   -2.26744   3.134294    -0.72   0.469    -8.410823    3.875943
           2000  |  -1.927371   3.134283    -0.61   0.539    -8.070734    4.215992
           2001  |  -1.875278   3.134352    -0.60   0.550    -8.018775     4.26822
           2002  |  -1.690621   3.134331    -0.54   0.590    -7.834077    4.452835
           2003  |  -1.475715   3.134319    -0.47   0.638    -7.619148    4.667717
           2004  |  -1.220183    3.13429    -0.39   0.697     -7.36356    4.923193
           2005  |  -1.153913    3.13433    -0.37   0.713    -7.297367    4.989541
           2006  |  -1.038949    3.13434    -0.33   0.740    -7.182423    5.104524
           2007  |  -1.146393   3.134395    -0.37   0.715    -7.289976    4.997189
           2008  |  -1.264413   3.134461    -0.40   0.687    -7.408124    4.879299
           2009  |  -.9995234   3.134537    -0.32   0.750    -7.143384    5.144337
           2010  |  -1.042056   3.134526    -0.33   0.740    -7.185894    5.101782
           2011  |  -1.117649   3.134483    -0.36   0.721    -7.261403    5.026105
           2012  |  -1.148772   3.134424    -0.37   0.714    -7.292411    4.994867
           2013  |  -1.191228   3.134365    -0.38   0.704    -7.334751    4.952295
           2014  |  -1.290347   3.134275    -0.41   0.681    -7.433693    4.852999
           2015  |  -1.477527   3.134301    -0.47   0.637    -7.620925     4.66587
           2016  |  -1.423933   3.134322    -0.45   0.650    -7.567371    4.719505
                 |
           _cons |   8.922157   3.133133     2.85   0.004     2.781048    15.06327
    ------------------------------------------------------------------------------
    And here comes the Mundlak equivalent (I first generate the yearly means):

    Code:
    . bysort year: egen mean_capex_w=mean(capex_w)
    . bysort year: egen mean_lev_w=mean(lev_w)
    . xtreg rating capex_w lev_w mean_capex_w mean_lev_w, i(year)
    
    Random-effects GLS regression                   Number of obs     =     26,561
    Group variable: year                            Number of groups  =         34
    
    R-sq:                                           Obs per group:
         within  = 0.2602                                         min =          1
         between = 0.1962                                         avg =      781.2
         overall = 0.2710                                         max =      1,024
    
                                                    Wald chi2(4)      =    9441.85
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
          rating |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         capex_w |  -.0034932   .3277473    -0.01   0.991    -.6458661    .6388798
           lev_w |   9.212831   .0956635    96.30   0.000     9.025334    9.400328
    mean_capex_w |  -45.04788   4.116032   -10.94   0.000    -53.11515   -36.98061
      mean_lev_w |  -2.917378   1.917391    -1.52   0.128    -6.675396      .84064
           _cons |   11.01925   .6841172    16.11   0.000     9.678405     12.3601
    -------------+----------------------------------------------------------------
         sigma_u |  .24895015
         sigma_e |  3.1326951
             rho |  .00627559   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    Ideally, I would also like to add company-fixed effects to this, but I assume then i would have to use multi-level which is perhaps too complicated for a paper which should be done within the next 2 weeks. However, if that is even possible (is there even possible to have a two-way Mundlak??), it would be extremely useful to get at least some references about that (or an answer on whether it is possible or not..)

    Thanks a lot!!
    Anamaria
    Last edited by ana cociorva; 20 May 2018, 09:10.

  • #2
    Realised I should have written the proper reference for Mundlak (1978) and some explanation for it :https://www.jstor.org/stable/1913646...n_tab_contents
    His point is that a random effects model with cross-sectional means for the varying-variables is equivalent with a cross-section FE model (but better for a number of reasons).
    In stata language: xtreg y x mean_x, re = xtreg y x,fe (where mean_x is created with bysort (id): egen mean_x= mean(x) and id is the panel cross section identifier)

    Comment


    • #3
      Ana:
      I've never seen a Mundlak corrected -re- model with means created sorting data on -timevar- vs -panelid-.
      Besides, your first model is an OLS with default standard errors, which gave back biased standard errors (as you omitted to declare that observations within panels are not independent).
      That said, in addition to spend some time in reading any decent panel data econometrics textbook, Stata covers Mundlak's approach at:
      - https://blog.stata.com/2015/10/29/fi...ak-approach/-;
      -ssc install mundlak-, from which you can access the user-written programme -mundlak- by Francisco (Paco) Perales (2013); see also https://ideas.repec.org/c/boc/bocode/s457601.html.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Originally posted by Carlo Lazzaro View Post
        Ana:
        I've never seen a Mundlak corrected -re- model with means created sorting data on -timevar- vs -panelid-.
        Besides, your first model is an OLS with default standard errors, which gave back biased standard errors (as you omitted to declare that observations within panels are not independent).
        That said, in addition to spend some time in reading any decent panel data econometrics textbook, Stata covers Mundlak's approach at:
        - https://blog.stata.com/2015/10/29/fi...ak-approach/-;
        -ssc install mundlak-, from which you can access the user-written programme -mundlak- by Francisco (Paco) Perales (2013); see also https://ideas.repec.org/c/boc/bocode/s457601.html.
        Hi, Carlo, How do we incorporate year and industry effect in a Mundlak's model? How do we modify the command
        mundlak y x1 x2, full
        for it to capture year and industry dummies like we use i.year and i.industry in xtreg? Should we create n-1 dummies for the year categories and then consider them as xi's? Kindly advise. Thanks
        Last edited by Nitin Jain; 02 Aug 2023, 00:06.

        Comment


        • #5
          Nitin:
          see https://www.statalist.org/forums/for...-fixed-effects
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Thanks, Carlo. So, I need to include n-1 year dummies like the other xi's.

            Comment


            • #7
              Nitin:
              correct.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Nitin:
                correct.
                Thanks, Carlo. I have another question on Mundlak's approach which I had posted here - https://www.statalist.org/forums/for...undlak-s-model

                Can you please help how to plot the interactions since it gives an error related mean_var not found, where var is one of the interaction variables.

                Comment

                Working...
                X