Announcement

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

  • omitting some results in table

    I am estimating some simple tobit models and wish to show several results in one table but I want to omit some of the results; here is an example do-file using the auto data:
    Code:
    sysuse auto, clear
    collect clear
    collect create Models1
    
    foreach num of numlist 1/5 {
        collect _r_b _r_se, name(Models1) tag(model[`num']): tobit mpg ibn.foreign if rep78==`num' , nocons
    }
    
    collect style showomit off
    collect style cell, nformat(%5.3f)
    
    collect recode Models1 5=.
    
    noi collect layout (model) (colname#result)
    I had thought that "collect style showomit off" would have eliminated the constant but it does not; note that I also want to exclude the two columns for "var(e.mpg)" ; here are the results of the above

    Code:
    Collection: Models1
          Rows: model
       Columns: colname#result
       Table 1: 5 x 8
    
    -----------------------------------------------------------------------------------------------
      |  Car origin Car origin  Car origin Car origin  var(e.mpg) var(e.mpg)   Intercept  Intercept
      |    Domestic   Domestic     Foreign    Foreign Coefficient Std. error Coefficient Std. error
      | Coefficient Std. error Coefficient Std. error                                              
    --+--------------------------------------------------------------------------------------------
    1 |      21.000      2.121                              9.000      9.000       0.000      0.000
    2 |      19.125      1.243                             12.359      6.180       0.000      0.000
    3 |      19.000      0.743      23.333      2.228      14.889      3.844       0.000      0.000
    4 |      18.444      1.184      24.889      1.184      12.617      4.206       0.000      0.000
    5 |      32.000      5.681      26.333      2.678      64.545     27.522       0.000      0.000
    -----------------------------------------------------------------------------------------------
    So, in the above table, I want the first 4 columns but want to omit the last four columns

  • #2
    Code:
    collect layout (model) (colname[foreign]#result)
    Code:
    Collection: Models1
          Rows: model
       Columns: colname[foreign]#result
       Table 1: 5 x 4
    
    -------------------------------------------------
      |  Car origin Car origin  Car origin Car origin
      |    Domestic   Domestic     Foreign    Foreign
      | Coefficient Std. error Coefficient Std. error
    --+----------------------------------------------
    1 |      21.000      2.121                       
    2 |      19.125      1.243                       
    3 |      19.000      0.743      23.333      2.228
    4 |      18.444      1.184      24.889      1.184
    5 |      32.000      5.681      26.333      2.678
    -------------------------------------------------
    Last edited by Bjarte Aagnes; 23 Dec 2022, 08:42.

    Comment


    • #3
      worked perfectly - thank you very much - rich

      Comment

      Working...
      X