Announcement

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

  • Esttab and reg3

    Hi everyone,

    I've looked online a little bit, but cannot find anything too definitive on the following matter. My goal is to esttab results from reg3 to be in a nicely presented table, just like I normally use via esttab for tex. However, I'm not sure how to call equation estimates from different lines in reg3. If you just use the normal esttab command, it will print the coefficients from the first equation in the simultaneous equations. How do you selectively choose the coefficients from, say, the second equation?

    Thank you!

  • #2
    Just wanted to check again in case anyone has any ideas!

    Comment


    • #3
      Use keep() or drop()to select the equations. In the example below, a model with two equations is tabulated. The unstack option is used to place the equations side-by-side.
      Code:
      . sysuse auto
      (1978 Automobile Data)
      
      . quietly reg3 (price mpg weight) (mpg weight foreign)
      
      . esttab, unstack nonumber nomtitle scalars(df_m rmse r2 chi2 p) noobs
      
      --------------------------------------------
                          price             mpg   
      --------------------------------------------
      mpg               -2204.2                   
                        (-1.49)                   
      
      weight             -11.20        -0.00659***
                        (-1.25)        (-10.56)   
      
      foreign                            -1.650   
                                        (-1.57)   
      
      _cons             86927.7           41.68***
                         (1.49)         (19.65)   
      --------------------------------------------
      df_m                    2               2   
      rmse               7712.6           3.337   
      r2                 -5.931           0.663   
      chi2                5.327           145.4   
      p                  0.0697        2.68e-32   
      --------------------------------------------
      t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      To keep only the "mpg" equation, type the following.
      Code:
      . esttab, unstack nonumber nomtitle scalars(df_m rmse r2 chi2 p) noobs keep(mpg:)
      
      ----------------------------
                            mpg   
      ----------------------------
      weight           -0.00659***
                       (-10.56)   
      
      foreign            -1.650   
                        (-1.57)   
      
      _cons               41.68***
                        (19.65)   
      ----------------------------
      df_m                    2   
      rmse                3.337   
      r2                  0.663   
      chi2                145.4   
      p                2.68e-32   
      ----------------------------
      t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      To drop the "mpg" equation, type the following.
      Code:
      . esttab, unstack nonumber nomtitle scalars(df_m rmse r2 chi2 p) noobs drop(mpg:)
      
      ----------------------------
                          price   
      ----------------------------
      mpg               -2204.2   
                        (-1.49)   
      
      weight             -11.20   
                        (-1.25)   
      
      _cons             86927.7   
                         (1.49)   
      ----------------------------
      df_m                    2   
      rmse               7712.6   
      r2                 -5.931   
      chi2                5.327   
      p                  0.0697   
      ----------------------------
      t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      ben

      Comment


      • #4
        Thank you!

        Comment

        Working...
        X