Announcement

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

  • Finding R squared and Adjusted R squared values on xtreg

    Hi Everyone,

    I am conducting research on panel data, set with xtset command on STATA.

    xtset company_id fiscalyear
    panel variable: company_id (unbalanced)
    time variable: fiscalyear, 1992 to 2018, but with gaps
    delta: 1 unit

    Now when I run xtreg to find the regression results, I am having trouble determining the R2 and Adjusted R2 figures that regular regression outputs generate. My xtreg output is following:

    xtreg PMP holder30 holder67 age sex

    Random-effects GLS regression Number of obs = 25,025
    Group variable: company_id Number of groups = 2,202

    R-sq: Obs per group:
    within = 0.0010 min = 1
    between = 0.0114 avg = 11.4
    overall = 0.0018 max = 26

    Wald chi2(4) = 43.75
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

    ------------------------------------------------------------------------------
    PMP | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    holder30 | .0156001 .0156502 1.00 0.319 -.0150738 .0462739
    holder67 | .0460581 .0133362 3.45 0.001 .0199197 .0721966
    age | -.0021195 .0006194 -3.42 0.001 -.0033336 -.0009054
    sex | .0428783 .0295993 1.45 0.147 -.0151353 .1008919
    _cons | .0325781 .0445875 0.73 0.465 -.0548119 .119968
    -------------+----------------------------------------------------------------
    sigma_u | .08218976
    sigma_e | .68331747
    rho | .01426107 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    Is there any command or something I need to do to find the the R squares?

    Thanks in advance!

  • #2
    Wali:
    -xtreg, re- actually does not return and Adjusted R-sq.
    That said, the R-sq that you should look at after -xtreg, re- is the -between- one (that looks pretty low in your example. I would check whether a groupwise effect does exist via -xttest0- after -xtreg):
    Code:
    . use "http://www.stata-press.com/data/r15/nlswork.dta"
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    . xtreg ln_wage age
    
    Random-effects GLS 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
    
                                                    Wald chi2(1)      =    3140.35
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
           _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
    -------------+----------------------------------------------------------------
         sigma_u |  .36972456
         sigma_e |  .30349389
             rho |  .59743613   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . xttest0
    
    Breusch and Pagan Lagrangian multiplier test for random effects
    
            ln_wage[idcode,t] = Xb + u[idcode] + e[idcode,t]
    
            Estimated results:
                             |       Var     sd = sqrt(Var)
                    ---------+-----------------------------
                     ln_wage |   .2285836       .4781042
                           e |   .0921085       .3034939
                           u |   .1366963       .3697246
    
            Test:   Var(u) = 0
                                 chibar2(01) = 28235.40
                              Prob > chibar2 =   0.0000
    
    .
    re-).
    Kind regards,
    Carlo
    (Stata 15.1 SE)

    Comment


    • #3
      Thank you Carlo Lazzaro for the additional test suggestion.

      I was concerned about the xtreg R squared issue after reading this post in particular.

      https://www.linkedin.com/pulse/how-g...bakr-al-gamrh/

      What's your take on this??

      Comment


      • #4
        Wali:
        set aside that you posted an -xtreg,re- code (so you should not mind about -fe-), I think that the issue here is not between right or wrong Rsq, but between different formulas that, in turn, produce different Rsq.
        Kind regards,
        Carlo
        (Stata 15.1 SE)

        Comment


        • #5
          thank you Carlo Lazzaro! Can you tell me exactly which one is usually used in top rated finance and economics journals??

          Comment


          • #6
            Wali:
            I'm not familiar with top rated finance and economics journals.
            That said, if you go -re-, I would report -R-sq: between-.
            Kind regards,
            Carlo
            (Stata 15.1 SE)

            Comment

            Working...
            X