Announcement

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

  • Panel data with time-fixed effects

    Dear readers,
    I am working on a panel data and I am trying to decide between OLS, (one or two-way) fixed effects and random effects.
    These are the characteristics of the panel data:
    Code:
     xtset teamid year
           panel variable:  teamid (unbalanced)
            time variable:  year, 1990 to 2005
                    delta:  1 unit
    The first thing that I do is to run the Hausman test. The results seem to support for fixed effects. Prob>chi2 < 0.05
    Code:
    xtreg y x1 x2 x3 x4 x5 x6 x7, fe
    estimates store fixed
    xtreg y x1 x2 x3 x4 x5 x6 x7, re
    estimates store random
    hausman fixed random
    Code:
     Test:  Ho:  difference in coefficients not systematic
    
                      chi2(7) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                              =       19.67
                    Prob>chi2 =      0.0063
    Secondly I test for time-fixed effects. The results seem to support for fixed-time effects, but not for team-fixed effects.
    Code:
     xtreg y x1 x2 x3 x4 x5 x6 x7 i.year, fe
    
    Fixed-effects (within) regression               Number of obs     =        423
    Group variable: teamid                          Number of groups  =         29
    
    R-sq:                                           Obs per group:
         within  = 0.4175                                         min =          9
         between = 0.9225                                         avg =       14.6
         overall = 0.5200                                         max =         15
    
                                                    F(21,373)         =      12.73
    corr(u_i, Xb)  = 0.3649                         Prob > F          =     0.0000
    
    --------------------------------------------------------------------------------------
                       y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
                      x1 |   .2976339   .0514635     5.78   0.000     .1964388    .3988289
                      x2 |  -1.197834   .6025895    -1.99   0.048    -2.382733   -.0129358
                      x3 |  -1.004244   1.703068    -0.59   0.556    -4.353061    2.344574
                      x4 |   14.66767   5.020646     2.92   0.004     4.795354    24.53999
                      x5 |  -2.157621   .4948095    -4.36   0.000    -3.130586   -1.184655
                      x6 |  -.8719717   .3822189    -2.28   0.023    -1.623546   -.1203977
                      x7 |   9.237686   9.208618     1.00   0.316    -8.869627      27.345
                         |
                    year |
                   1992  |   2.259566    2.68975     0.84   0.401     -3.02941    7.548541
                   1993  |    .312609   2.843719     0.11   0.913    -5.279122     5.90434
                   1994  |    .029145   2.904487     0.01   0.992    -5.682077    5.740367
                   1995  |    .756507   2.997573     0.25   0.801    -5.137754    6.650768
                   1996  |   7.127056   3.009425     2.37   0.018      1.20949    13.04462
                   1997  |   3.209303   3.092813     1.04   0.300    -2.872233    9.290839
                   1998  |    .056752   3.131287     0.02   0.986    -6.100435    6.213939
                   1999  |  -8.521511   3.113896    -2.74   0.007     -14.6445   -2.398519
                   2000  |   5.357031   3.118691     1.72   0.087    -.7753893    11.48945
                   2001  |  -2.571675   3.084095    -0.83   0.405    -8.636068    3.492718
                   2002  |  -3.055465   3.086275    -0.99   0.323    -9.124144    3.013214
                   2003  |  -3.455438   3.112955    -1.11   0.268     -9.57658    2.665704
                   2004  |  -.4980288   3.185596    -0.16   0.876    -6.762007    5.765949
                   2005  |  -.3646745   3.818328    -0.10   0.924    -7.872823    7.143474
                         |
                   _cons |   39.25244   10.12028     3.88   0.000     19.35249     59.1524
    ---------------------+----------------------------------------------------------------
                 sigma_u |  2.9698973
                 sigma_e |  9.4862393
                     rho |  .08926603   (fraction of variance due to u_i)
    --------------------------------------------------------------------------------------
    F test that all u_i=0: F(28, 373) = 0.98                     Prob > F = 0.5004
    
    . testparm i.year
    
     ( 1)  1992.year = 0
     ( 2)  1993.year = 0
     ( 3)  1994.year = 0
     ( 4)  1995.year = 0
     ( 5)  1996.year = 0
     ( 6)  1997.year = 0
     ( 7)  1998.year = 0
     ( 8)  1999.year = 0
     ( 9)  2000.year = 0
     (10)  2001.year = 0
     (11)  2002.year = 0
     (12)  2003.year = 0
     (13)  2004.year = 0
     (14)  2005.year = 0
    
           F( 14,   373) =    4.21
                Prob > F =    0.0000
    At this point, it seems that I should keep only the time-dummy variables in my model. Is it so? Do I need to run --regress-- with the option --vce(cluster teamid)-- now? Thank you.
    Code:
    regress y x1 x2 x3 x4 x5 x6 x7 i.year, vce(cluster teamid)

  • #2
    Jacopo:
    as the F-test of alL u_I being=0 does not raech statistical significance, pooled OLS (with the option --vce(cluster teamid)) outperforms -xtreg, fe-.
    However, I would keep the -xs-, too in your POLS model.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks for your quick answer, Carlo. Can I ask you what you mean by keeping the -xs-?

      Comment


      • #4
        Jacopo:
        yes, of course.
        I meant your x1....x7 predictors.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hello Carlo and Jacopo,

          Could you please tell us how did you conclude that individual-fixed effect is not appropriate?
          +
          Is it safe to call the last line of code a time fixed-effect estimation?
          +
          What is the difference between vce(cluster id) VS. cluster(id)? If both applicable, which one is better?


          Thanks,
          Abdullah
          Last edited by Abdullah Helal; 25 Mar 2019, 15:40.

          Comment


          • #6
            Abdullah:
            welcome to this forum.
            -
            Code:
            F test that all u_i=0: F(28, 373) = 0.98
            answers your first question;
            --i.time- is often called time-fixed effect (although you cannot retrieve it from -xtreg postestimation-);
            - I usually go vce(cluster id), when needed; I'm not familiar with the other notation that probably dates back to some Stata releases ago.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you so much Carlo.
              Last edited by Abdullah Helal; 26 Mar 2019, 08:54.

              Comment

              Working...
              X