Announcement

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

  • xtreg vs areg in case of clustered std errors.

    Hello everyone,

    I have a question regarding the following: I use cross section (in my case banks) fixed effects in my regression on panel data. Untill now I have used the areg option for this, with obsorbing at the bank level ( absorb(gvkey) ). When I was talking to my thesis supervisor and told her that I wanted to use both bank fixed effects and cluster standard errors on the bank level, she told me that this is not right as this is doing the same thing twice (Are you guys agree on this??). To test what she said I used both robust and cluster with xtreg, and the results were the same. However, when I use areg absorb(gvkey) robust or areg absorb (gvkey) cluster (gvkey) results do differ. My question is, how can this differ between areg (where the cluster and robust option results in different regression results) and xtreg( where using robust or cluster does not change regression results). I have searched the statalist forum already and read this post: http://www.stata.com/statalist/archi.../msg00596.html . However, I sill dont get why using cluster differs between areg and xtreg.

    Here some results:

    Areg with robust

    Code:
    . areg mliq L.Hqualitybank Hbank_Crisis  size nim  racr loanstoassets depositsloans L.Crisisdummy fedfund tedspread
    > changeinflation,absorb(gvkey) r
    
    Linear regression, absorbing indicators           Number of obs   =       3755
                                                      F(  11,   3615) =      42.87
                                                      Prob > F        =     0.0000
                                                      R-squared       =     0.8284
                                                      Adj R-squared   =     0.8218
                                                      Root MSE        =     0.0258
    
    ---------------------------------------------------------------------------------
                    |               Robust
               mliq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
       Hqualitybank |
                L1. |  -.0048897   .0016137    -3.03   0.002    -.0080536   -.0017258
                    |
       Hbank_Crisis |   .0015343   .0027677     0.55   0.579    -.0038921    .0069606
               size |   .0037692   .0016317     2.31   0.021       .00057    .0069684
                nim |  -.0034188    .001323    -2.58   0.010    -.0060127   -.0008249
               racr |   .0016591   .0003786     4.38   0.000     .0009168    .0024014
      loanstoassets |  -.0460795   .0131867    -3.49   0.000    -.0719336   -.0202253
      depositsloans |   .0278637   .0039698     7.02   0.000     .0200803    .0356471
                    |
        Crisisdummy |
                L1. |   .0057046   .0017564     3.25   0.001      .002261    .0091483
                    |
            fedfund |  -.0014908   .0003294    -4.53   0.000    -.0021365    -.000845
          tedspread |  -.0030266   .0011774    -2.57   0.010    -.0053351   -.0007181
    changeinflation |   .0001491   .0014236     0.10   0.917     -.002642    .0029402
              _cons |  -.0023362   .0230833    -0.10   0.919    -.0475939    .0429215
    ----------------+----------------------------------------------------------------
              gvkey |   absorbed                                     (129 categories)
    VS areg with cluster

    Code:
    . areg mliq L.Hqualitybank Hbank_Crisis  size nim  racr loanstoassets depositsloans L.Crisisdummy fedfund tedspread
    > changeinflation,absorb(gvkey) cluster(gvkey)
    
    Linear regression, absorbing indicators           Number of obs   =       3755
                                                      F(  11,    128) =       6.64
                                                      Prob > F        =     0.0000
                                                      R-squared       =     0.8284
                                                      Adj R-squared   =     0.8218
                                                      Root MSE        =     0.0258
    
                                       (Std. Err. adjusted for 129 clusters in gvkey)
    ---------------------------------------------------------------------------------
                    |               Robust
               mliq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
       Hqualitybank |
                L1. |  -.0048897   .0041795    -1.17   0.244    -.0131595    .0033802
                    |
       Hbank_Crisis |   .0015343   .0045884     0.33   0.739    -.0075447    .0106132
               size |   .0037692   .0048582     0.78   0.439    -.0058435     .013382
                nim |  -.0034188   .0028916    -1.18   0.239    -.0091403    .0023028
               racr |   .0016591   .0009438     1.76   0.081    -.0002084    .0035266
      loanstoassets |  -.0460795   .0374456    -1.23   0.221     -.120172     .028013
      depositsloans |   .0278637   .0115271     2.42   0.017     .0050555    .0506719
                    |
        Crisisdummy |
                L1. |   .0057046   .0034413     1.66   0.100    -.0011045    .0125138
                    |
            fedfund |  -.0014908    .000876    -1.70   0.091    -.0032241    .0002426
          tedspread |  -.0030266   .0018372    -1.65   0.102    -.0066618    .0006085
    changeinflation |   .0001491   .0019137     0.08   0.938    -.0036375    .0039358
              _cons |  -.0023362   .0799416    -0.03   0.977    -.1605142    .1558418
    ----------------+----------------------------------------------------------------
              gvkey |   absorbed                                     (129 categories)
    xtreg with robust

    Code:
    . xtreg mliq L.Hqualitybank Hbank_Crisis  size nim  racr loanstoassets depositsloans L.Crisisdummy fedfund tedspread
    >  changeinflation,fe r
    
    Fixed-effects (within) regression               Number of obs      =      3755
    Group variable: gvkey                           Number of groups   =       129
    
    R-sq:  within  = 0.2504                         Obs per group: min =         1
           between = 0.2905                                        avg =      29.1
           overall = 0.3465                                        max =        54
    
                                                    F(11,128)          =      6.87
    corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000
    
                                       (Std. Err. adjusted for 129 clusters in gvkey)
    ---------------------------------------------------------------------------------
                    |               Robust
               mliq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
       Hqualitybank |
                L1. |  -.0048897   .0041074    -1.19   0.236    -.0130169    .0032375
                    |
       Hbank_Crisis |   .0015343   .0045093     0.34   0.734    -.0073881    .0104566
               size |   .0037692   .0047744     0.79   0.431    -.0056777    .0132162
                nim |  -.0034188   .0028417    -1.20   0.231    -.0090417    .0022041
               racr |   .0016591   .0009276     1.79   0.076    -.0001762    .0034944
      loanstoassets |  -.0460795   .0367998    -1.25   0.213    -.1188941    .0267351
      depositsloans |   .0278637   .0113282     2.46   0.015     .0054488    .0502786
                    |
        Crisisdummy |
                L1. |   .0057046   .0033819     1.69   0.094    -.0009871    .0123963
                    |
            fedfund |  -.0014908   .0008609    -1.73   0.086    -.0031942    .0002127
          tedspread |  -.0030266   .0018055    -1.68   0.096    -.0065991    .0005458
    changeinflation |   .0001491   .0018807     0.08   0.937    -.0035722    .0038705
              _cons |  -.0023362   .0785628    -0.03   0.976    -.1577861    .1531137
    ----------------+----------------------------------------------------------------
            sigma_u |  .03901529
            sigma_e |  .02583222
                rho |  .69522501   (fraction of variance due to u_i)
    ---------------------------------------------------------------------------------
    Xtreg with cluster

    Code:
    . xtreg mliq L.Hqualitybank Hbank_Crisis  size nim  racr loanstoassets depositsloans L.Crisisdummy fedfund tedspread
    >  changeinflation,fe cluster(gvkey)
    
    Fixed-effects (within) regression               Number of obs      =      3755
    Group variable: gvkey                           Number of groups   =       129
    
    R-sq:  within  = 0.2504                         Obs per group: min =         1
           between = 0.2905                                        avg =      29.1
           overall = 0.3465                                        max =        54
    
                                                    F(11,128)          =      6.87
    corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000
    
                                       (Std. Err. adjusted for 129 clusters in gvkey)
    ---------------------------------------------------------------------------------
                    |               Robust
               mliq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
       Hqualitybank |
                L1. |  -.0048897   .0041074    -1.19   0.236    -.0130169    .0032375
                    |
       Hbank_Crisis |   .0015343   .0045093     0.34   0.734    -.0073881    .0104566
               size |   .0037692   .0047744     0.79   0.431    -.0056777    .0132162
                nim |  -.0034188   .0028417    -1.20   0.231    -.0090417    .0022041
               racr |   .0016591   .0009276     1.79   0.076    -.0001762    .0034944
      loanstoassets |  -.0460795   .0367998    -1.25   0.213    -.1188941    .0267351
      depositsloans |   .0278637   .0113282     2.46   0.015     .0054488    .0502786
                    |
        Crisisdummy |
                L1. |   .0057046   .0033819     1.69   0.094    -.0009871    .0123963
                    |
            fedfund |  -.0014908   .0008609    -1.73   0.086    -.0031942    .0002127
          tedspread |  -.0030266   .0018055    -1.68   0.096    -.0065991    .0005458
    changeinflation |   .0001491   .0018807     0.08   0.937    -.0035722    .0038705
              _cons |  -.0023362   .0785628    -0.03   0.976    -.1577861    .1531137
    ----------------+----------------------------------------------------------------
            sigma_u |  .03901529
            sigma_e |  .02583222
                rho |  .69522501   (fraction of variance due to u_i)
    ---------------------------------------------------------------------------------
    So question 1) do you agree about the fact that using clustering on the same level as you apply fixed effects is redundant? and question 2) How is it possible that results differ between xtreg and areg when applying clustering?

    Thank you in advance for your answers!

    Yannick
    Last edited by YH jordaan; 31 Jan 2016, 16:09.

  • #2
    On page 402 of the [XT] manual you will find in the section on options for the FE model,
    Specifying vce(robust) is equivalent to specifying vce(cluster panelvar); see xtreg, fe in Methods and formulas.
    By contrast -areg- treats -vce(robust)- as simply specifying the robust "sandwich" estimator without automatically incorporating the cluster corrections.

    Using a fixed effects model and specifying cluster robust standard errors is not doing the same thing twice. The use of fixed effects accounts for within-cluster correlation of observations by "taking out" a common intercept for each group. But it is not always the case that the resulting residuals are now independent. If intra-group residual correlation remains after fixed effects are included, the additional use of cluster robust vce may be appropriate, if the number of clusters is sufficiently large. (Your 129 clusters is probably fine in this regard.)

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      On page 402 of the [XT] manual you will find in the section on options for the FE model,


      By contrast -areg- treats -vce(robust)- as simply specifying the robust "sandwich" estimator without automatically incorporating the cluster corrections.

      Using a fixed effects model and specifying cluster robust standard errors is not doing the same thing twice. The use of fixed effects accounts for within-cluster correlation of observations by "taking out" a common intercept for each group. But it is not always the case that the resulting residuals are now independent. If intra-group residual correlation remains after fixed effects are included, the additional use of cluster robust vce may be appropriate, if the number of clusters is sufficiently large. (Your 129 clusters is probably fine in this regard.)

      Thanks for your answer! With respect to the fact that after the use of fixed effects it may be the case that residuals are still not independent: how can I test for this? I know I can test my variables on serial correlation with either the xtcorr or xtserial commands, but you cant apply this on a fixed effects model.

      Comment


      • #4
        Well, one approach might be to -predict- the residuals and then calculate the intra-class correlation with -icc-. But, though I didn't mention it earlier, the cluster robust VCE also deals with issues of heteroskedasticity. So you may want to explore for that as well, in whatever way you normally do that.

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          Well, one approach might be to -predict- the residuals and then calculate the intra-class correlation with -icc-. But, though I didn't mention it earlier, the cluster robust VCE also deals with issues of heteroskedasticity. So you may want to explore for that as well, in whatever way you normally do that.
          I looked into the stata manual and the only thing I see is the application of icc with random or mixed models. Furthermore, when I searched for help icc in stata I got ''No entries found for icc''. Is predicting e and testing e with xtserial equivalent to using icc?

          Note: i have stata version 12.

          Comment


          • #6
            I'm not familiar with -xtserial-. It's not an official Stata command, by the way.

            Comment

            Working...
            X