Announcement

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

  • Tobit results with etable

    The following code produces a table with one column for each of two tobit regressions.

    Code:
    clear
    use https://www.stata-press.com/data/r18/gpa.dta
    tobit gpa2 hsgpa pincome program, ll
    estimates store e1
    tobit gpa2 hsgpa hscomp pincome  program, ll
    estimates store e2
    
    etable, estimates(e1 e2)
    Result:
    Code:
    ----------------------------------------------------
                                           gpa2    gpa2
    ----------------------------------------------------
    High school GPA                        0.659   0.695
                                         (0.013) (0.013)
    Parent's income                        0.316   0.312
                                         (0.007) (0.007)
    Participate in program                 0.555   0.543
                                         (0.015) (0.015)
    High school competitiveness category          -0.091
                                                 (0.009)
    Intercept                             -0.890  -0.792
                                         (0.048) (0.048)
    var(e.gpa2)                            0.162   0.157
                                         (0.004) (0.004)
    Number of observations                  4000    4000
    ----------------------------------------------------
    However, addition of the following lines adds separate columns for the var(e.gpa2) terms.

    Code:
    collect stars _r_p 0.01 "**"  0.05 "*" , attach(_r_b) shownote
    collect layout (colname[]#result[_r_b _r_se]) ///
     (cmdset#coleq#stars[])
    Result:

    Code:
    Collection: ETable
          Rows: colname[]#result[_r_b _r_se]
       Columns: cmdset#coleq#stars[]
       Table 1: 12 x 6
    
    --------------------------------------------------------------------------
                                                tobit              tobit      
    --------------------------------------------------------------------------
    High school GPA                        0.659 **           0.695 **        
                                         (0.013)            (0.013)           
    Parent's income                        0.316 **           0.312 **        
                                         (0.007)            (0.007)           
    Participate in program                 0.555 **           0.543 **        
                                         (0.015)            (0.015)           
    var(e.gpa2)                                       0.162              0.157
                                                    (0.004)            (0.004)
    High school competitiveness category                     -0.091 **        
                                                            (0.009)           
    Intercept                             -0.890 **          -0.792 **        
                                         (0.048)            (0.048)           
    --------------------------------------------------------------------------
    ** p<.01, * p<.05


    How do I get the variance terms lined up in the original two columns?

    Thanks,
    Devra
    Devra Golbe
    Professor Emerita, Dept. of Economics
    Hunter College, CUNY

  • #2
    Code:
    . etable, estimates(e1 e2) showstars showstarsnote stars(0.01 "**"  0.05 "*")
    
    ----------------------------------------------------------
                                            gpa2       gpa2   
    ----------------------------------------------------------
    High school GPA                        0.659 **   0.695 **
                                         (0.013)    (0.013)   
    Parent's income                        0.316 **   0.312 **
                                         (0.007)    (0.007)   
    Participate in program                 0.555 **   0.543 **
                                         (0.015)    (0.015)   
    High school competitiveness category             -0.091 **
                                                    (0.009)   
    Intercept                             -0.890 **  -0.792 **
                                         (0.048)    (0.048)   
    var(e.gpa2)                            0.162      0.157   
                                         (0.004)    (0.004)   
    Number of observations                  4000       4000   
    ----------------------------------------------------------
    ** p<.01, * p<.05

    Comment


    • #3
      Thank you! Based on your code, I figured out that the following also produces the desired results ( as well as additional elaborations) :

      Code:
      etable, estimates(e1 e2)
      collect stars _r_p 0.01 "**"  0.05 "*" , attach(_r_b) shownote
      collect label levels colname hscomp "HS competitiveness", modify
      collect label levels etable_depvar 1 "model 1" 2 "model 2", modify
      collect layout
      
      
      --------------------------------------
                             model 1 model 2
      --------------------------------------
      High school GPA          0.659   0.695
                             (0.013) (0.013)
      Parent's income          0.316   0.312
                             (0.007) (0.007)
      Participate in program   0.555   0.543
                             (0.015) (0.015)
      HS competitiveness              -0.091
                                     (0.009)
      Intercept               -0.890  -0.792
                             (0.048) (0.048)
      var(e.gpa2)              0.162   0.157
                             (0.004) (0.004)
      Number of observations    4000    4000
      --------------------------------------
      ** p<.01, * p<.05
      Devra Golbe
      Professor Emerita, Dept. of Economics
      Hunter College, CUNY

      Comment


      • #4
        Oops. I should be more careful. The code in #3 does not show the stars. This does

        Code:
        etable, estimates(e1 e2) showstars showstarsnote stars(0.01 "**"  0.05 "*")
        collect label levels colname hscomp "HS competitiveness", modify
        collect label levels etable_depvar 1 "model 1" 2 "model 2", modify
        collect layout
        Devra Golbe
        Professor Emerita, Dept. of Economics
        Hunter College, CUNY

        Comment

        Working...
        X