Announcement

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

  • Help Regarding "esttab"

    Greetings Everyone!

    Hopefully, you will be fine, I want to add Groups(Firms) in the Regression Table using esttab option,
    Kindly Help me in this regard.

    Thanks in Advance

  • #2
    estout is from the Stata Journal/ SSC (FAQ Advice #12). Do you want to add the number of groups as a statistic?

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      estout is from the Stata Journal/ SSC (FAQ Advice #12). Do you want to add the number of groups as a statistic?
      Yes Sir,

      Comment


      • #4
        Code:
        webuse grunfeld, clear
        xtreg invest mvalue kstock, fe
        esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
        Res.:

        Code:
        . esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
        
        ----------------------------
                              (1)   
                           invest   
        ----------------------------
        mvalue              0.110***
                           (9.29)   
        
        kstock              0.310***
                          (17.87)   
        
        _cons              -58.74***
                          (-4.72)   
        ----------------------------
        Observations          200   
        Groups (Fi~)           10   
        ----------------------------
        t statistics in parentheses
        * p<0.05, ** p<0.01, *** p<0.001

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          Code:
          webuse grunfeld, clear
          xtreg invest mvalue kstock, fe
          esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
          Res.:

          Code:
          . esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
          
          ----------------------------
          (1)
          invest
          ----------------------------
          mvalue 0.110***
          (9.29)
          
          kstock 0.310***
          (17.87)
          
          _cons -58.74***
          (-4.72)
          ----------------------------
          Observations 200
          Groups (Fi~) 10
          ----------------------------
          t statistics in parentheses
          * p<0.05, ** p<0.01, *** p<0.001
          Thank You Sir

          Comment


          • #6
            Originally posted by Andrew Musau View Post
            Code:
            webuse grunfeld, clear
            xtreg invest mvalue kstock, fe
            esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
            Res.:

            Code:
            . esttab, stats(N N_g, labels(Observations "Groups (Firms)"))
            
            ----------------------------
            (1)
            invest
            ----------------------------
            mvalue 0.110***
            (9.29)
            
            kstock 0.310***
            (17.87)
            
            _cons -58.74***
            (-4.72)
            ----------------------------
            Observations 200
            Groups (Fi~) 10
            ----------------------------
            t statistics in parentheses
            * p<0.05, ** p<0.01, *** p<0.001
            Dear Sir, Now r2 and ar2 are not showing in the esttab,

            after applying the above mentioned syntax

            Comment


            • #7
              Code:
              . esttab, stats(N N_g r2 r2_a, labels(Observations "Groups (Firms)" R-squared "Adj. R-squared"))
              
              ----------------------------
                                    (1)   
                                 invest   
              ----------------------------
              mvalue              0.110***
                                 (9.29)   
              
              kstock              0.310***
                                (17.87)   
              
              _cons              -58.74***
                                (-4.72)   
              ----------------------------
              Observations          200   
              Groups (Fi~)           10   
              R-squared           0.767   
              Adj. R-squ~d        0.753   
              ----------------------------
              t statistics in parentheses
              * p<0.05, ** p<0.01, *** p<0.001

              Comment


              • #8
                Originally posted by Andrew Musau View Post
                Code:
                . esttab, stats(N N_g r2 r2_a, labels(Observations "Groups (Firms)" R-squared "Adj. R-squared"))
                
                ----------------------------
                (1)
                invest
                ----------------------------
                mvalue 0.110***
                (9.29)
                
                kstock 0.310***
                (17.87)
                
                _cons -58.74***
                (-4.72)
                ----------------------------
                Observations 200
                Groups (Fi~) 10
                R-squared 0.767
                Adj. R-squ~d 0.753
                ----------------------------
                t statistics in parentheses
                * p<0.05, ** p<0.01, *** p<0.001
                Thank You Very Much! Respected Sir

                Comment


                • #9
                  Originally posted by Andrew Musau View Post
                  Code:
                  . esttab, stats(N N_g r2 r2_a, labels(Observations "Groups (Firms)" R-squared "Adj. R-squared"))
                  
                  ----------------------------
                  (1)
                  invest
                  ----------------------------
                  mvalue 0.110***
                  (9.29)
                  
                  kstock 0.310***
                  (17.87)
                  
                  _cons -58.74***
                  (-4.72)
                  ----------------------------
                  Observations 200
                  Groups (Fi~) 10
                  R-squared 0.767
                  Adj. R-squ~d 0.753
                  ----------------------------
                  t statistics in parentheses
                  * p<0.05, ** p<0.01, *** p<0.001
                  Hi Andrew,

                  Hopefully you will be fine, Dear although this command is working/ showing the r2, ar2 and F statistics for Fixed Effect Regression, while this command is not working on Random Effect, Is there any particular Reason?
                  if you help me in this regard.
                  Thanks in Advance

                  Comment


                  • #10
                    You can see what options are available and how statistics are named by typing ereturn list after the command.

                    Code:
                    webuse grunfeld
                    xtreg invest mvalue kstock, re
                    ereturn list
                    Res.:

                    Code:
                    . xtreg invest mvalue kstock, re
                    
                    Random-effects GLS regression                   Number of obs     =        200
                    Group variable: company                         Number of groups  =         10
                    
                    R-sq:                                           Obs per group:
                         within  = 0.7668                                         min =         20
                         between = 0.8196                                         avg =       20.0
                         overall = 0.8061                                         max =         20
                    
                                                                    Wald chi2(2)      =     657.67
                    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                    
                    ------------------------------------------------------------------------------
                          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                          mvalue |   .1097811   .0104927    10.46   0.000     .0892159    .1303464
                          kstock |    .308113   .0171805    17.93   0.000     .2744399    .3417861
                           _cons |  -57.83441   28.89893    -2.00   0.045    -114.4753   -1.193537
                    -------------+----------------------------------------------------------------
                         sigma_u |   84.20095
                         sigma_e |  52.767964
                             rho |  .71800838   (fraction of variance due to u_i)
                    ------------------------------------------------------------------------------
                    
                    .
                    . ereturn list
                    
                    scalars:
                                   e(rank) =  3
                                   e(df_m) =  2
                                   e(chi2) =  657.6739058280266
                                      e(p) =  1.5414374407e-143
                                e(sigma_u) =  84.20095021446555
                                e(sigma_e) =  52.76796426523782
                                  e(sigma) =  99.36930144524676
                                    e(rho) =  .7180083776382998
                                   e(rmse) =  52.78555504840494
                                      e(N) =  200
                                   e(Tbar) =  20
                                   e(Tcon) =  1
                                    e(N_g) =  10
                                  e(g_min) =  20
                                  e(g_avg) =  20
                                  e(g_max) =  20
                                  e(theta) =  .8612236243102899
                                   e(r2_o) =  .8061042309946248
                                   e(r2_b) =  .819632572937444
                                   e(r2_w) =  .7667569332870343

                    As the random effects estimator is a mixture of the within and between estimators, you probably will want to report the overall R2. No adjusted R2 is reported after random effects. Also, after fixed effects, due to the inclusion of the fixed effects in the adjustment of the within-R2 statistic, the adjusted R2 reported by Stata is not very meaningful, so I would not report it at all. See my suggestion in #9 of the following thread: https://www.statalist.org/forums/for...ted-as-missing

                    Comment


                    • #11
                      Originally posted by Andrew Musau View Post
                      You can see what options are available and how statistics are named by typing ereturn list after the command.

                      Code:
                      webuse grunfeld
                      xtreg invest mvalue kstock, re
                      ereturn list
                      Res.:

                      Code:
                      . xtreg invest mvalue kstock, re
                      
                      Random-effects GLS regression Number of obs = 200
                      Group variable: company Number of groups = 10
                      
                      R-sq:  Obs per group:
                       within = 0.7668  min = 20
                      between = 0.8196  avg = 20.0
                      overall = 0.8061 max = 20
                      
                      Wald chi2(2) = 657.67
                      corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
                      
                      ------------------------------------------------------------------------------
                      invest | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                      mvalue | .1097811 .0104927 10.46 0.000 .0892159 .1303464
                      kstock | .308113 .0171805 17.93 0.000 .2744399 .3417861
                      _cons | -57.83441 28.89893 -2.00 0.045 -114.4753 -1.193537
                      -------------+----------------------------------------------------------------
                      sigma_u | 84.20095
                      sigma_e | 52.767964
                      rho | .71800838 (fraction of variance due to u_i)
                      ------------------------------------------------------------------------------
                      
                      .
                      . ereturn list
                      
                      scalars:
                      e(rank) = 3
                      e(df_m) = 2
                      e(chi2) = 657.6739058280266
                      e(p) = 1.5414374407e-143
                      e(sigma_u) = 84.20095021446555
                      e(sigma_e) = 52.76796426523782
                      e(sigma) = 99.36930144524676
                      e(rho) = .7180083776382998
                      e(rmse) = 52.78555504840494
                      e(N) = 200
                      e(Tbar) = 20
                      e(Tcon) = 1
                      e(N_g) = 10
                      e(g_min) = 20
                      e(g_avg) = 20
                      e(g_max) = 20
                      e(theta) = .8612236243102899
                      e(r2_o) = .8061042309946248
                      e(r2_b) = .819632572937444
                      e(r2_w) = .7667569332870343

                      As the random effects estimator is a mixture of the within and between estimators, you probably will want to report the overall R2. No adjusted R2 is reported after random effects. Also, after fixed effects, due to the inclusion of the fixed effects in the adjustment of the within-R2 statistic, the adjusted R2 reported by Stata is not very meaningful, so I would not report it at all. See my suggestion in #9 of the following thread: https://www.statalist.org/forums/for...ted-as-missing
                      Thank You Andrew for your Explanation.

                      Comment

                      Working...
                      X