Announcement

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

  • Is e(r2_a) the adjusted within R-squared in xtreg, fe?

    Dear statalist,

    I have run a fixed-effects regression by xtreg, fe r, and then use ereturn list to produce adjusted R-square. I find that e(r2) is the same as e(r2_w), the within R-squared. So may I ask if e(r2_a) is just the adjusted within R-squared?

    Thank you very much!

  • #2
    Alex:
    yes it is, but it differs in decimal digits from e(r2_w), as you can see from the following toy-example:
    Code:
    . xtreg ln_wage age, fe r
    
    Fixed-effects (within) regression               Number of obs     =     28,510
    Group variable: idcode                          Number of groups  =      4,710
    
    R-sq:                                           Obs per group:
         within  = 0.1026                                         min =          1
         between = 0.0877                                         avg =        6.1
         overall = 0.0774                                         max =         15
    
                                                    F(1,4709)         =     884.05
    corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
    
                                 (Std. Err. adjusted for 4,710 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             age |   .0181349   .0006099    29.73   0.000     .0169392    .0193306
           _cons |   1.148214   .0177153    64.81   0.000     1.113483    1.182944
    -------------+----------------------------------------------------------------
         sigma_u |  .40635023
         sigma_e |  .30349389
             rho |  .64192015   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . ereturn list
    
    scalars:
                   e(r2_w) =  .1025747671254915
                   e(rank) =  1
                   e(Tbar) =  6.053078556263269
                   e(Tcon) =  0
                  e(g_min) =  1
                  e(g_avg) =  6.053078556263269
                  e(g_max) =  15
                    e(N_g) =  4710
                e(sigma_u) =  .4063502328846532
                   e(corr) =  .0313506604859547
                   e(r2_o) =  .0773811195932452
                   e(r2_b) =  .0876851602614176
                e(sigma_e) =  .3034938911233301
                  e(sigma) =  .5071775366817735
                    e(rho) =  .6419201461924331
                      e(p) =  3.4442776666e-178
                   e(df_m) =  0
                   e(df_b) =  1
                      e(F) =  884.0510055602717
                   e(ll_0) =  -5426.929832151553
                     e(ll) =  -3884.175784681907
                    e(tss) =  6516.690152088633
                   e(df_a) =  4709
                   e(r2_a) =  .1025432873572554
                    e(rss) =  2192.091189848528
                    e(mss) =  250.5537342607759
                   e(rmse) =  .2772974866348904
                     e(r2) =  .1025747671254915
                   e(df_r) =  4709
                      e(N) =  28510
                e(N_clust) =  4710
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Alex:
      yes it is, but it differs in decimal digits from e(r2_w), as you can see from the following toy-example:
      Dear Carlo,

      Many thanks!

      Comment


      • #4
        Dear Alex, how are you.
        I stumbled in this thread by accident, but I would like to ask you.
        What is the purpose of the r next to the ",fe" at the end of your command?

        Comment


        • #5
          Alvaro:
          welcome to this forum.
          -r- is the abbreviation of -robust- (ie, cluster-robust standard error).
          Interestingly, while you can invoke it via -robust- or -vce(cluster clusterid)- in -xtreg- (as both these options do the very same job, that is taking heteroskedasticity and/or autocorrelation into account), in -regress- the -robust- option takes heteroskedasticity only into account, whereas -.vce(cluster clusterid- does the same with autocorrelation of the epsilon.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X