Announcement

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

  • Panel regression with time dummies

    Hi,

    I've just done a fixed effect and random effect regression with time dummies for both, and the coefficients for all the variables are identical. What does this mean and does this seem right?

    Folabi

  • #2
    You can view the random effects estimator as a weighted combination of the within (fixed effects) and between estimators (see Theil and Goldberger, Internatinal Economic Review, 1961 for a derivation of this). Here, they show that the random effects estimator weighs these estimators inversely with respect to their variances. If you do not have any between variation in your data, then the random effects estimator reduces to the fixed effects estimator and you will obtain the same estimates. Here is an example based on the Grunfeld data set.

    Here, the observations of company 1 vary across time. If I duplicate these observations twice and refer to them as company 2 and company 3, the observations of all 3 "firms" will still vary across time but not between the firms.

    Code:
    webuse grunfeld
    keep if company==1
    expand 3
    bys company year: replace company=_n
    sort company year
    list, sepby(company)
    Code:
    . list, sepby(company)
    
         +--------------------------------------------------+
         | company   year   invest   mvalue   kstock   time |
         |--------------------------------------------------|
      1. |       1   1935    317.6   3078.5      2.8      1 |
      2. |       1   1936    391.8   4661.7     52.6      2 |
      3. |       1   1937    410.6   5387.1    156.9      3 |
      4. |       1   1938    257.7   2792.2    209.2      4 |
      5. |       1   1939    330.8   4313.2    203.4      5 |
      6. |       1   1940    461.2   4643.9    207.2      6 |
      7. |       1   1941      512   4551.2    255.2      7 |
      8. |       1   1942      448   3244.1    303.7      8 |
      9. |       1   1943    499.6   4053.7    264.1      9 |
     10. |       1   1944    547.5   4379.3    201.6     10 |
     11. |       1   1945    561.2   4840.9      265     11 |
     12. |       1   1946    688.1   4900.9    402.2     12 |
     13. |       1   1947    568.9   3526.5    761.5     13 |
     14. |       1   1948    529.2   3254.7    922.4     14 |
     15. |       1   1949    555.1   3700.2   1020.1     15 |
     16. |       1   1950    642.9   3755.6     1099     16 |
     17. |       1   1951    755.9     4833   1207.7     17 |
     18. |       1   1952    891.2   4924.9   1430.5     18 |
     19. |       1   1953   1304.4   6241.7   1777.3     19 |
     20. |       1   1954   1486.7   5593.6   2226.3     20 |
         |--------------------------------------------------|
     21. |       2   1935    317.6   3078.5      2.8      1 |
     22. |       2   1936    391.8   4661.7     52.6      2 |
     23. |       2   1937    410.6   5387.1    156.9      3 |
     24. |       2   1938    257.7   2792.2    209.2      4 |
     25. |       2   1939    330.8   4313.2    203.4      5 |
     26. |       2   1940    461.2   4643.9    207.2      6 |
     27. |       2   1941      512   4551.2    255.2      7 |
     28. |       2   1942      448   3244.1    303.7      8 |
     29. |       2   1943    499.6   4053.7    264.1      9 |
     30. |       2   1944    547.5   4379.3    201.6     10 |
     31. |       2   1945    561.2   4840.9      265     11 |
     32. |       2   1946    688.1   4900.9    402.2     12 |
     33. |       2   1947    568.9   3526.5    761.5     13 |
     34. |       2   1948    529.2   3254.7    922.4     14 |
     35. |       2   1949    555.1   3700.2   1020.1     15 |
     36. |       2   1950    642.9   3755.6     1099     16 |
     37. |       2   1951    755.9     4833   1207.7     17 |
     38. |       2   1952    891.2   4924.9   1430.5     18 |
     39. |       2   1953   1304.4   6241.7   1777.3     19 |
     40. |       2   1954   1486.7   5593.6   2226.3     20 |
         |--------------------------------------------------|
     41. |       3   1935    317.6   3078.5      2.8      1 |
     42. |       3   1936    391.8   4661.7     52.6      2 |
     43. |       3   1937    410.6   5387.1    156.9      3 |
     44. |       3   1938    257.7   2792.2    209.2      4 |
     45. |       3   1939    330.8   4313.2    203.4      5 |
     46. |       3   1940    461.2   4643.9    207.2      6 |
     47. |       3   1941      512   4551.2    255.2      7 |
     48. |       3   1942      448   3244.1    303.7      8 |
     49. |       3   1943    499.6   4053.7    264.1      9 |
     50. |       3   1944    547.5   4379.3    201.6     10 |
     51. |       3   1945    561.2   4840.9      265     11 |
     52. |       3   1946    688.1   4900.9    402.2     12 |
     53. |       3   1947    568.9   3526.5    761.5     13 |
     54. |       3   1948    529.2   3254.7    922.4     14 |
     55. |       3   1949    555.1   3700.2   1020.1     15 |
     56. |       3   1950    642.9   3755.6     1099     16 |
     57. |       3   1951    755.9     4833   1207.7     17 |
     58. |       3   1952    891.2   4924.9   1430.5     18 |
     59. |       3   1953   1304.4   6241.7   1777.3     19 |
     60. |       3   1954   1486.7   5593.6   2226.3     20 |
         +--------------------------------------------------+
    To see that there is no between variation, we can run xtsum.

    Code:
    . xtsum invest mvalue kstock
    
    Variable         |      Mean   Std. Dev.       Min        Max |    Observations
    -----------------+--------------------------------------------+----------------
    invest   overall |    608.02   304.2824      257.7     1486.7 |     N =      60
             between |                    0     608.02     608.02 |     n =       3
             within  |             304.2824      257.7     1486.7 |     T =      20
                     |                                            |
    mvalue   overall |  4333.845   888.8454     2792.2     6241.7 |     N =      60
             between |                    0   4333.845   4333.845 |     n =       3
             within  |             888.8454     2792.2     6241.7 |     T =      20
                     |                                            |
    kstock   overall |   648.435   619.3913        2.8     2226.3 |     N =      60
             between |                    0    648.435    648.435 |     n =       3
             within  |             619.3913        2.8     2226.3 |     T =      20
    Finally, you can verify that fixed effects and random effects yield the same estimates in the absence of between variation in the data.

    Code:
    . xtreg invest mvalue kstock, fe
    
    Fixed-effects (within) regression               Number of obs     =         60
    Group variable: company                         Number of groups  =          3
    
    R-sq:                                           Obs per group:
         within  = 0.9214                                         min =         20
         between =      .                                         avg =       20.0
         overall = 0.9214                                         max =         20
    
                                                    F(2,55)           =     322.17
    corr(u_i, Xb)  =      .                         Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1192808   .0143627     8.30   0.000     .0904972    .1480644
          kstock |   .3714448    .020611    18.02   0.000     .3301395    .4127501
           _cons |  -149.7824   58.84392    -2.55   0.014    -267.7083   -31.85655
    -------------+----------------------------------------------------------------
         sigma_u |          0
         sigma_e |  88.381153
             rho |          0   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(2, 55) = 0.00                       Prob > F = 1.0000
    
    . xtreg invest mvalue kstock, re
    
    Random-effects GLS regression                   Number of obs     =         60
    Group variable: company                         Number of groups  =          3
    
    R-sq:                                           Obs per group:
         within  = 0.0000                                         min =         20
         between = 0.0000                                         avg =       20.0
         overall = 0.9214                                         max =         20
    
                                                    Wald chi2(2)      =     667.77
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1192808   .0141085     8.45   0.000     .0916286     .146933
          kstock |   .3714448   .0202462    18.35   0.000     .3317631    .4111266
           _cons |  -149.7824   57.80235    -2.59   0.010    -263.0729   -36.49187
    -------------+----------------------------------------------------------------
         sigma_u |          0
         sigma_e |  88.381153
             rho |          0   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    Last edited by Andrew Musau; 15 Apr 2019, 10:11.

    Comment

    Working...
    X