Announcement

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

  • year dummies in xtreg and pooled OLS

    Hello,

    I ran both a fixed effects model and pooled OLS model on the same dataset. I am now wondering if, including year dummies and thus time effects, is comparable in both regressions. In the literature they mention "time fixed effects" to control for variables that are constant acreoss firms but change over time in the fixed effects model and "aggregate time effects" in the pooled OLS model. I am now wondering if the regression happens in a different way concerning these time dummies. And if so, what is the difference?

    Kind regards,
    Timea

  • #2
    Timea:
    the main issue here is that pooled OLS and -xtreg,fe- are different estimators.
    Besides, I'm not clear whether, by "aggregate time effects", you mean -c.time- vs -i.time-.
    As usual, sharing what you typed and what Stata gave you back (as per FAQ) would help enormously interested listers in replying more positively to your queries.
    Last edited by Carlo Lazzaro; 29 Jun 2020, 01:19.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo, what I meant was i.time

      Comment


      • #4
        Timea:
        if you mean:
        Code:
        . use "https://www.stata-press.com/data/r16/nlswork.dta"
        (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
        
        . reg ln_wage i.year i.idcode c.age##c.age if idcode<=4
        
              Source |       SS           df       MS      Number of obs   =        50
        -------------+----------------------------------   F(19, 30)       =      3.05
               Model |  4.79792411        19  .252522321   Prob > F        =    0.0031
            Residual |  2.48217063        30  .082739021   R-squared       =    0.6590
        -------------+----------------------------------   Adj R-squared   =    0.4431
               Total |  7.28009473        49  .148573362   Root MSE        =    .28764
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                year |
                 69  |    .224994   .5374605     0.42   0.678    -.8726469    1.322635
                 70  |   .1649135   .7700301     0.21   0.832    -1.407698    1.737525
                 71  |   .1712431    1.09509     0.16   0.877    -2.065229    2.407715
                 72  |   .3136266   1.433598     0.22   0.828    -2.614171    3.241424
                 73  |   .4386164   1.777538     0.25   0.807      -3.1916    4.068833
                 75  |    .575746   2.473349     0.23   0.818    -4.475507    5.626999
                 77  |    .651904   3.179439     0.21   0.839    -5.841377    7.145185
                 78  |   .9314592     3.5311     0.26   0.794    -6.280009    8.142927
                 80  |   .9700889    4.23391     0.23   0.820    -7.676708    9.616886
                 82  |   1.063147   4.948233     0.21   0.831    -9.042493    11.16879
                 83  |   1.379563   5.299088     0.26   0.796    -9.442619    12.20175
                 85  |   1.854813   6.012334     0.31   0.760    -10.42401    14.13364
                 87  |   2.153058   6.728032     0.32   0.751    -11.58742    15.89353
                 88  |   2.571633   7.355941     0.35   0.729     -12.4512    17.59447
                     |
              idcode |
                  2  |   -.394374   .1194999    -3.30   0.002    -.6384254   -.1503226
                  3  |   .1010589   2.101252     0.05   0.962     -4.19027    4.392388
                  4  |   .5522662   2.131432     0.26   0.797    -3.800699    4.905231
                     |
                 age |   .2364322   .3462718     0.68   0.500    -.4707491    .9436135
                     |
         c.age#c.age |  -.0056102   .0011932    -4.70   0.000    -.0080471   -.0031734
                     |
               _cons |  -1.093667   5.581352    -0.20   0.846    -12.49231    10.30497
        ------------------------------------------------------------------------------
        
        . xtreg ln_wage i.year c.age##c.age if idcode<=4, fe
        
        Fixed-effects (within) regression               Number of obs     =         50
        Group variable: idcode                          Number of groups  =          4
        
        R-sq:                                           Obs per group:
             within  = 0.5342                                         min =         11
             between = 0.0151                                         avg =       12.5
             overall = 0.2227                                         max =         15
        
                                                        F(16,30)          =       2.15
        corr(u_i, Xb)  = -0.6249                        Prob > F          =     0.0342
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                year |
                 69  |    .224994   .5374605     0.42   0.678    -.8726469    1.322635
                 70  |   .1649135   .7700301     0.21   0.832    -1.407698    1.737525
                 71  |   .1712431    1.09509     0.16   0.877    -2.065229    2.407715
                 72  |   .3136266   1.433598     0.22   0.828    -2.614171    3.241424
                 73  |   .4386164   1.777538     0.25   0.807      -3.1916    4.068833
                 75  |    .575746   2.473349     0.23   0.818    -4.475507    5.626999
                 77  |    .651904   3.179439     0.21   0.839    -5.841377    7.145185
                 78  |   .9314592     3.5311     0.26   0.794    -6.280009    8.142927
                 80  |   .9700889    4.23391     0.23   0.820    -7.676708    9.616886
                 82  |   1.063147   4.948233     0.21   0.831    -9.042493    11.16879
                 83  |   1.379563   5.299088     0.26   0.796    -9.442619    12.20175
                 85  |   1.854813   6.012334     0.31   0.760    -10.42401    14.13364
                 87  |   2.153058   6.728032     0.32   0.751    -11.58742    15.89353
                 88  |   2.571633   7.355941     0.35   0.729     -12.4512    17.59447
                     |
                 age |   .2364322   .3462718     0.68   0.500    -.4707491    .9436135
                     |
         c.age#c.age |  -.0056102   .0011932    -4.70   0.000    -.0080471   -.0031734
                     |
               _cons |  -1.036501   6.663463    -0.16   0.877    -14.64511    12.57211
        -------------+----------------------------------------------------------------
             sigma_u |  .38900632
             sigma_e |  .28764391
                 rho |  .64651254   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(3, 30) = 8.22                       Prob > F = 0.0004
        set aside the _cons, the results are perfecty the same, as you do the same regression with two different approaches.

        Conversely, what above does not hold for pooled OLS vs -xtreg,fe- (because they are two different beasts):
        Code:
        . reg ln_wage i.year c.age##c.age if idcode<=4, vce(cluster idcode)
        
        Linear regression                               Number of obs     =         50
                                                        F(2, 3)           =          .
                                                        Prob > F          =          .
                                                        R-squared         =     0.3789
                                                        Root MSE          =     .37015
        
                                         (Std. Err. adjusted for 4 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                year |
                 69  |   .1486743   .0549624     2.71   0.073    -.0262406    .3235891
                 70  |    .277369   .2887149     0.96   0.408    -.6414508    1.196189
                 71  |   .1301287   .2621698     0.50   0.654    -.7042125      .96447
                 72  |   .1961925   .2197171     0.89   0.438    -.5030453    .8954304
                 73  |   .2437975   .1144552     2.13   0.123      -.12045     .608045
                 75  |   .2229619   .0470414     4.74   0.018     .0732552    .3726686
                 77  |   .0565625   .2272149     0.25   0.819    -.6665367    .7796618
                 78  |   .2544722   .4275434     0.60   0.594    -1.106162    1.615106
                 80  |   .2037513    .589187     0.35   0.752    -1.671305    2.078807
                 82  |   .0580069   .6546599     0.09   0.935    -2.025413    2.141427
                 83  |   .3523115   .6776646     0.52   0.639     -1.80432    2.508943
                 85  |   .6482934   .7762536     0.84   0.465    -1.822092    3.118679
                 87  |   .7630092   .8329341     0.92   0.427    -1.887759    3.413777
                 88  |     1.0182    .886308     1.15   0.334    -1.802428    3.838827
                     |
                 age |   .2887857    .133158     2.17   0.119    -.1349825     .712554
                     |
         c.age#c.age |  -.0050776   .0021492    -2.36   0.099    -.0119174    .0017622
                     |
               _cons |  -2.402156   1.992439    -1.21   0.314    -8.742986    3.938675
        ------------------------------------------------------------------------------
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X