Announcement

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

  • adjusted R-squared using area versus reghdfe

    Dear Statalist community,

    I have a model that controls for many fixed effects and clustered standard errors by one of the controlled fixed effects. I found reghdfe gives me very different adjusted R-squared when clustering standard errors vs. not clustering standard errors. But areg gives the same adjusted R-squared regardless of clustering or not clustering standard errors. I'd like to ask:
    1. Should we generally trust the adjusted R-squared from reghdfe when controlling for several fixed effects and also clustering at a level that is controlled as fixed effects?
    2. Does anyone know how areg estimate adjusted R-squared? I didn't find it in the areg manual.
    Thank you.


  • #2
    Yiqun:
    welcome to this forum.
    1) as the community-contributed command (as you're kindly requested to detail; please see the FAQ on this and other posting-related topics. Thanks) -reghdfe- focuses on within variation, you should consider -within R-sq- (just like you would do with -xtreg,fe-).
    2) areg estimate adjusted R-squared as -regress- does.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks a lot Carlo. I'd like to ask if the adjusted R-squared estimated by areg would be different between clustering vs. not clustering standard errors at a level that is also absorbed as fixed effects?

      Comment


      • #4
        Yi:
        no, it isn't, as you can easily prove yourself via the following toy-example:
        Code:
        . use  http://www.stata-press.com/data/r16/auto2.dta
        (1978 Automobile Data)
        
        . help areg
        
        . areg mpg weight gear_ratio, absorb(rep78)
        
        Linear regression, absorbing indicators         Number of obs     =         69
        Absorbed variable: rep78                        No. of categories =          5
                                                        F(   2,     62)   =      41.64
                                                        Prob > F          =     0.0000
                                                        R-squared         =     0.6734
                                                        Adj R-squared     =     0.6418
                                                        Root MSE          =     3.5109
        
        ------------------------------------------------------------------------------
                 mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              weight |  -.0051031   .0009206    -5.54   0.000    -.0069433    -.003263
          gear_ratio |    .901478   1.565552     0.58   0.567    -2.228015    4.030971
               _cons |   34.05889   7.056383     4.83   0.000     19.95338     48.1644
        ------------------------------------------------------------------------------
        F test of absorbed indicators: F(4, 62) = 1.117               Prob > F = 0.356
        
        . areg mpg weight gear_ratio, absorb(rep78) vce(cluster foreign)
        
        Linear regression, absorbing indicators         Number of obs     =         69
        Absorbed variable: rep78                        No. of categories =          5
                                                        F(   1,      1)   =          .
                                                        Prob > F          =          .
                                                        R-squared         =     0.6734
                                                        Adj R-squared     =     0.6418
                                                        Root MSE          =     3.4829
        
                                        (Std. Err. adjusted for 2 clusters in foreign)
        ------------------------------------------------------------------------------
                     |               Robust
                 mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              weight |  -.0051031   .0009415    -5.42   0.116    -.0170654    .0068592
          gear_ratio |    .901478   2.589644     0.35   0.787    -32.00307    33.80602
               _cons |   34.05889   11.25922     3.02   0.203     -109.003    177.1208
        ------------------------------------------------------------------------------
        
        .
        Last edited by Carlo Lazzaro; 24 May 2021, 01:16.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks a lot Carlo.

          Comment

          Working...
          X