Announcement

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

  • Different results OLS / GLS regression - how to choose the best model

    Hello!

    I'm writing a thesis on how director reputation changes overtime. Director reputation is derived from market cap of the companies the individual director is holding seats in. I ran both an OLS and a GLS regression and get very different but significant results. I have very limited background in data science and therefore have trouble understanding which model is best suited for my research question. Any help or feedback would be greatly appreciated.

    I ran a test for autocorrelation (below) and I tried running the test for heteroskedasticity but I get an error that my stata version only allows up to 800 rows. However to my understanding my data should be homoscedastic.
    Code:
    . xtserial DirRep YearVar
    
    Wooldridge test for autocorrelation in panel data
    H0: no first-order autocorrelation
        F(  1,    6811) =   3121.669
               Prob > F =      0.0000
    Below you can find the regression results and I've included an example of my data set.

    Code:
    . reg DirRep YearVar
    
          Source |       SS           df       MS      Number of obs   =    50,484
    -------------+----------------------------------   F(1, 50482)     =    244.00
           Model |  157338.357         1  157338.357   Prob > F        =    0.0000
        Residual |  32552654.4    50,482   644.83686   R-squared       =    0.0048
    -------------+----------------------------------   Adj R-squared   =    0.0048
           Total |  32709992.7    50,483  647.940747   Root MSE        =    25.394
    
    ------------------------------------------------------------------------------
          DirRep | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         YearVar |    .659354   .0422111    15.62   0.000     .5766199    .7420882
           _cons |    60.9483   .2171544   280.67   0.000     60.52267    61.37392
    ------------------------------------------------------------------------------
    Code:
    . xtreg DirRep YearVar, re
    
    Random-effects GLS regression                   Number of obs     =     50,484
    Group variable: DirectorID                      Number of groups  =      8,035
    
    R-squared:                                      Obs per group:
         Within  = 0.0016                                         min =          1
         Between = 0.0376                                         avg =        6.3
         Overall = 0.0048                                         max =         10
    
                                                    Wald chi2(1)      =      49.53
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
          DirRep | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         YearVar |  -.0896029   .0127312    -7.04   0.000    -.1145557   -.0646501
           _cons |    61.7649   .2896927   213.21   0.000     61.19711    62.33269
    -------------+----------------------------------------------------------------
         sigma_u |  25.341588
         sigma_e |  6.7111548
             rho |  .93446266   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double DirectorID byte YearVar int(DirYOB Network) byte(NoNed ExecVar) double DirRep
      216931  1 1951 4313 1 0                 61
      216931  2 1951 4313 1 0                 64
      216931  3 1951 4313 1 0                 62
      216931  4 1951 4313 1 0                 60
      216931  5 1951 4313 1 0                 65
      722610  1 1939  635 1 0                 96
      722610  2 1939  635 1 0                 97
      722610  3 1939  635 1 0                 97
      722610  4 1939  635 1 0                 97
      722610  5 1939  635 1 0                 97
      722610  6 1939  635 1 0                 96
      722610  7 1939  635 1 0                 97
      722610  8 1939  635 1 0                 96
      722610  9 1939  635 1 0                 96
      722610 10 1939  635 1 0                 96
      722650  1 1945 2968 1 0                 85
      722650  2 1945 2968 1 0                 82
      722650  3 1945 2968 1 0                 82
      722650  4 1945 2968 1 0                 82
      722650  5 1945 2968 1 0                 83
      722650  6 1945 2968 1 0                 85
      722650  7 1945 2968 1 0                 84
      722650  8 1945 2968 1 0                 85
      722650  9 1945 2968 1 0                 82
     1050210  1 1955 1176 1 0                 71
     1050210  2 1955 1176 1 0                 68
     1050210  3 1955 1176 1 0                 67
     1050210  4 1955 1176 1 0                 68
     1050210  5 1955 1176 1 0                 77
     1050210  6 1955 1176 1 0                 83
     1050210  7 1955 1176 1 0                 81
     1050210  8 1955 1176 1 0                 79
     1050210  9 1955 1176 1 0                 77
     2224030  1 1950 1081 1 1                 90
     2224030  2 1950 1081 1 1                 88
     2224030  3 1950 1081 1 1                 88
     2224030  4 1950 1081 1 1                 90
     2224030  5 1950 1081 1 1                 89
     2224030  6 1950 1081 1 1                 89
     2224030  7 1950 1081 1 1                 89
     2224030  8 1950 1081 1 1                 90
     2224030  9 1950 1081 1 1                 87
     2224030 10 1950 1081 1 1                 87
     2224190  1 1954  326 1 1                 52
     2224190  2 1954  326 1 1                 52
     2224190  3 1954  326 1 1                 48
     2224190  4 1954  326 1 1                 42
     2224200  1 1947  204 1 0                 52
     2224200  2 1947  204 1 0                 52
     2224200  3 1947  204 1 0                 48
     2224200  4 1947  204 1 0                 42
     2224220  1 1951  849 2 1                 84
     2224220  2 1951  849 2 1                 85
     2224220  3 1951  849 2 1               85.5
     2224220  4 1951  849 2 1                 84
     2224220  5 1951  849 2 1                 84
     2224220  6 1951  849 2 1                 82
     2224220  7 1951  849 2 1                 81
     2224220  8 1951  849 2 1                 74
     2224220  9 1951  849 2 1                 76
     2224220 10 1951  849 2 1                 73
     2224240  1 1938    0 1 0                 70
     2224240  2 1938    0 1 0                 76
     2224240  3 1938    0 1 0                 78
     2224240  4 1938    0 1 0                 77
     2224240  5 1938    0 1 0                 79
     2224240  6 1938    0 1 0                 78
     2224490  1 1960 1331 1 0                 16
     2224490  2 1960 1331 1 0                 16
     2224490  3 1960 1331 1 0 28.000000000000004
     2224490  4 1960 1331 1 0                 33
     2224490  5 1960 1331 1 0                 27
     2224490  6 1960 1331 1 0                 37
     2224490  7 1960 1331 1 0                 36
     2224660  1 1940  152 1 0                 54
     2224660  2 1940  152 1 0                 49
     2224660  3 1940  152 1 0                 36
     2224660  4 1940  152 1 0                 50
     2224660  5 1940  152 1 0  56.00000000000001
     2224660  6 1940  152 1 0                 45
     2224660  7 1940  152 1 0                 46
     2224710  1 1959 1119 1 1                 90
     5354000  1 1953 1405 1 0                 23
     5354000  2 1953 1405 1 0                 15
     5354000  3 1953 1405 1 0                 10
     5354000  4 1953 1405 1 0                  5
     5354570  1 1965  377 1 0                 50
     5354570  2 1965  377 1 0                 50
     5354570  3 1965  377 1 0                 53
     5354600  1 1959  766 1 1                 44
     5354600  2 1959  766 1 1                 44
     5354600  3 1959  766 1 1                 47
     5354600  4 1959  766 1 1                 46
     5354600  5 1959  766 1 1                 48
    10509380  1 1967  699 1 0                 65
    10509380  2 1967  699 1 0                 60
    11223500  1 1945 7042 1 0                 92
    11223500  2 1945 7042 1 0                 92
    11223500  3 1945 7042 1 0                 92
    11223500  4 1945 7042 1 0                 88
    end

  • #2
    Lukas:
    welcome to this forum.
    I do nit think that simple (ie, one predictor only) -xtreg,re- is the way to go.
    Let's consider a more comprehensive specification (that takes epsilon serial correlation into account via clustered-robust standard error):
    Code:
    . xtreg DirRep DirYOB Network i.NoNed i.ExecVar i.YearVar, re vce(cluster DirectorID)
    
    Random-effects GLS regression                   Number of obs     =        100
    Group variable: DirectorID                      Number of groups  =         17
    
    R-squared:                                      Obs per group:
         Within  = 0.1373                                         min =          1
         Between = 0.3076                                         avg =        5.9
         Overall = 0.3700                                         max =         10
    
                                                    Wald chi2(13)     =     816.63
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
    
                                (Std. err. adjusted for 17 clusters in DirectorID)
    ------------------------------------------------------------------------------
                 |               Robust
          DirRep | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          DirYOB |  -1.072154   .6280329    -1.71   0.088    -2.303076    .1587678
         Network |   .0040719   .0015061     2.70   0.007     .0011199    .0070239
         2.NoNed |   7.817649   10.58676     0.74   0.460    -12.93201    28.56731
       1.ExecVar |   15.73905   13.04277     1.21   0.228    -9.824316    41.30242
                 |
         YearVar |
              2  |  -1.058689   .8917731    -1.19   0.235    -2.806533    .6891538
              3  |  -1.558684   2.009247    -0.78   0.438    -5.496737    2.379368
              4  |  -2.094609   2.269346    -0.92   0.356    -6.542446    2.353228
              5  |   1.909904   1.370548     1.39   0.163    -.7763198    4.596128
              6  |   2.360147   2.995047     0.79   0.431    -3.510037    8.230331
              7  |   2.024124   3.008328     0.67   0.501     -3.87209    7.920338
              8  |  -.0402538   3.194675    -0.01   0.990    -6.301701    6.221194
              9  |  -1.240254   2.627256    -0.47   0.637    -6.389581    3.909074
             10  |  -3.557544   3.188553    -1.12   0.265    -9.806994    2.691906
                 |
           _cons |   2145.934   1224.106     1.75   0.080    -253.2693    4545.138
    -------------+----------------------------------------------------------------
         sigma_u |  14.951358
         sigma_e |  4.4206272
             rho |  .91960861   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . xttest0
    
    Breusch and Pagan Lagrangian multiplier test for random effects
    
            DirRep[DirectorID,t] = Xb + u[DirectorID] + e[DirectorID,t]
    
            Estimated results:
                             |       Var     SD = sqrt(Var)
                    ---------+-----------------------------
                      DirRep |   546.2039       23.37101
                           e |   19.54194       4.420627
                           u |   223.5431       14.95136
    
            Test: Var(u) = 0
                                 chibar2(01) =   145.70
                              Prob > chibar2 =   0.0000
    
    .
    The -xtest0- outcome highlights the evidence of a panel-wise effect.
    It remains to be seen whether the -fe- specification outperforms (or not) its -re- counterpart.
    Last edited by Carlo Lazzaro; 07 Sep 2022, 01:14.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo thank you for your response. I reran the xttest with the full sample. I additionally ran the hausman test. To my understanding since the hausman test has a significant result -xtreg fe- performs better for my data. Please correct me if my understanding of the result is wrong.

      Code:
      . xtreg DirRep DirYOB Network NoNed i.ExecVar i.YearVar, re vce(cluster DirectorID)
      
      Random-effects GLS regression                   Number of obs     =     50,135
      Group variable: DirectorID                      Number of groups  =      7,931
      
      R-squared:                                      Obs per group:
           Within  = 0.0018                                         min =          1
           Between = 0.0791                                         avg =        6.3
           Overall = 0.0823                                         max =         10
      
                                                      Wald chi2(13)     =     595.92
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
      
                               (Std. err. adjusted for 7,931 clusters in DirectorID)
      ------------------------------------------------------------------------------
                   |               Robust
            DirRep | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            DirYOB |  -.2962917   .0346972    -8.54   0.000     -.364297   -.2282863
           Network |   .0027472   .0001725    15.93   0.000     .0024092    .0030852
             NoNed |   3.667816   .7214028     5.08   0.000     2.253892    5.081739
         1.ExecVar |   7.640639   .6397912    11.94   0.000     6.386671    8.894607
                   |
           YearVar |
                2  |  -.1928387   .0660118    -2.92   0.003    -.3222195    -.063458
                3  |   -.147535   .0954459    -1.55   0.122    -.3346055    .0395354
                4  |  -.1725029    .119633    -1.44   0.149    -.4069792    .0619734
                5  |  -.3111402    .144727    -2.15   0.032       -.5948   -.0274805
                6  |  -.6507579   .1733776    -3.75   0.000    -.9905717    -.310944
                7  |  -.4305499   .1868957    -2.30   0.021    -.7968587    -.064241
                8  |  -.6747144   .2115455    -3.19   0.001    -1.089336   -.2600928
                9  |  -.7855907   .2362873    -3.32   0.001    -1.248705   -.3224761
               10  |  -.9114981   .2705466    -3.37   0.001     -1.44176   -.3812366
                   |
             _cons |   628.8924   67.99912     9.25   0.000     495.6166    762.1682
      -------------+----------------------------------------------------------------
           sigma_u |  24.484223
           sigma_e |  6.7142413
               rho |  .93005902   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . xttest0
      
      Breusch and Pagan Lagrangian multiplier test for random effects
      
              DirRep[DirectorID,t] = Xb + u[DirectorID] + e[DirectorID,t]
      
              Estimated results:
                               |       Var     SD = sqrt(Var)
                      ---------+-----------------------------
                        DirRep |   645.6736       25.41011
                             e |   45.08104       6.714241
                             u |   599.4772       24.48422
      
              Test: Var(u) = 0
                                   chibar2(01) =  1.2e+05
                                Prob > chibar2 =   0.0000
      Code:
      . xtreg DirRep DirYOB Network NoNed ExecVar YearVar, fe
      note: DirYOB omitted because of collinearity.
      note: Network omitted because of collinearity.
      note: NoNed omitted because of collinearity.
      note: ExecVar omitted because of collinearity.
      
      Fixed-effects (within) regression               Number of obs     =     50,135
      Group variable: DirectorID                      Number of groups  =      7,931
      
      R-squared:                                      Obs per group:
           Within  = 0.0016                                         min =          1
           Between = 0.0350                                         avg =        6.3
           Overall = 0.0045                                         max =         10
      
                                                      F(1,42203)        =      67.10
      corr(u_i, Xb) = -0.0803                         Prob > F          =     0.0000
      
      ------------------------------------------------------------------------------
            DirRep | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            DirYOB |          0  (omitted)
           Network |          0  (omitted)
             NoNed |          0  (omitted)
           ExecVar |          0  (omitted)
           YearVar |  -.1044712   .0127534    -8.19   0.000    -.1294681   -.0794742
             _cons |   64.37682   .0636361  1011.64   0.000     64.25209    64.50155
      -------------+----------------------------------------------------------------
           sigma_u |  25.994368
           sigma_e |  6.7142622
               rho |  .93745555   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      F test that all u_i=0: F(7930, 42203) = 84.82                Prob > F = 0.0000
      
      . estimate store fe
      
      . xtreg DirRep DirYOB Network NoNed ExecVar YearVar, re
      
      Random-effects GLS regression                   Number of obs     =     50,135
      Group variable: DirectorID                      Number of groups  =      7,931
      
      R-squared:                                      Obs per group:
           Within  = 0.0016                                         min =          1
           Between = 0.0790                                         avg =        6.3
           Overall = 0.0822                                         max =         10
      
                                                      Wald chi2(5)      =     757.34
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
      
      ------------------------------------------------------------------------------
            DirRep | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            DirYOB |  -.2965575   .0327458    -9.06   0.000     -.360738    -.232377
           Network |   .0027473   .0001487    18.48   0.000     .0024559    .0030387
             NoNed |   3.669598   .3592822    10.21   0.000     2.965418    4.373779
           ExecVar |   7.640648   .6431661    11.88   0.000     6.380066     8.90123
           YearVar |  -.0944415   .0127433    -7.41   0.000    -.1194179    -.069465
             _cons |   629.5002   64.03687     9.83   0.000     503.9902    755.0101
      -------------+----------------------------------------------------------------
           sigma_u |  24.479526
           sigma_e |  6.7142622
               rho |  .93003364   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . estimate store re
      
      . hausman fe re
      
                       ---- Coefficients ----
                   |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                   |       fe           re         Difference       Std. err.
      -------------+----------------------------------------------------------------
           YearVar |   -.1044712    -.0944415       -.0100297        .0005071
      ------------------------------------------------------------------------------
                                b = Consistent under H0 and Ha; obtained from xtreg.
                 B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
      
      Test of H0: Difference in coefficients not systematic
      
          chi2(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                  = 391.15
      Prob > chi2 = 0.0000

      Comment


      • #4
        Lukas:
        if you should go clustered-robust standard errors, -hausman- does not help, whereas the community-contributed module -xtoverid- (null: -re- is the way to go) can lend you a hand.
        Being glorious but a bit old-fashioned, -xtoverid- does not support -fvvarlist- notation: the -fix- is to prefix your -xtreg,re- code with -xi:-:
        Code:
        . xtset DirectorID YearVar
        
        Panel variable: DirectorID (unbalanced)
         Time variable: YearVar, 1 to 10
                 Delta: 1 unit
        
        . xi: xtreg DirRep DirYOB Network i.NoNed i.ExecVar i.YearVar, re vce(cluster DirectorID)
        i.NoNed           _INoNed_1-2         (naturally coded; _INoNed_1 omitted)
        i.ExecVar         _IExecVar_0-1       (naturally coded; _IExecVar_0 omitted)
        i.YearVar         _IYearVar_1-10      (naturally coded; _IYearVar_1 omitted)
        
        Random-effects GLS regression                   Number of obs     =        100
        Group variable: DirectorID                      Number of groups  =         17
        
        R-squared:                                      Obs per group:
             Within  = 0.1373                                         min =          1
             Between = 0.3076                                         avg =        5.9
             Overall = 0.3700                                         max =         10
        
                                                        Wald chi2(13)     =     816.63
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
                                    (Std. err. adjusted for 17 clusters in DirectorID)
        ------------------------------------------------------------------------------
                     |               Robust
              DirRep | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
              DirYOB |  -1.072154   .6280329    -1.71   0.088    -2.303076    .1587678
             Network |   .0040719   .0015061     2.70   0.007     .0011199    .0070239
           _INoNed_2 |   7.817649   10.58676     0.74   0.460    -12.93201    28.56731
         _IExecVar_1 |   15.73905   13.04277     1.21   0.228    -9.824316    41.30242
         _IYearVar_2 |  -1.058689   .8917731    -1.19   0.235    -2.806533    .6891538
         _IYearVar_3 |  -1.558684   2.009247    -0.78   0.438    -5.496737    2.379368
         _IYearVar_4 |  -2.094609   2.269346    -0.92   0.356    -6.542446    2.353228
         _IYearVar_5 |   1.909904   1.370548     1.39   0.163    -.7763198    4.596128
         _IYearVar_6 |   2.360147   2.995047     0.79   0.431    -3.510037    8.230331
         _IYearVar_7 |   2.024124   3.008328     0.67   0.501     -3.87209    7.920338
         _IYearVar_8 |  -.0402538   3.194675    -0.01   0.990    -6.301701    6.221194
         _IYearVar_9 |  -1.240254   2.627256    -0.47   0.637    -6.389581    3.909074
        _IYearVar_10 |  -3.557544   3.188553    -1.12   0.265    -9.806994    2.691906
               _cons |   2145.934   1224.106     1.75   0.080    -253.2693    4545.138
        -------------+----------------------------------------------------------------
             sigma_u |  14.951358
             sigma_e |  4.4206272
                 rho |  .91960861   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . xtoverid
        
        Test of overidentifying restrictions: fixed vs random effects
        Cross-section time-series model: xtreg re  robust cluster(DirectorID)
        Sargan-Hansen statistic 5974.545  Chi-sq(8)   P-value = 0.0000
        
        .
        The -xtoverid- outcome confirms that -fe- is the way to go with your dataset.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X