Announcement

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

  • etable

    Hello everyone,
    Can I generate a table with a horizontal table? Example: coefficient, 95% CI, pvalue.
    Thank you so much

  • #2
    You'll have to reach out for collect to get that layout.

    Code:
    sysuse auto, clear
    collect clear
    regress mpg weight disp turn
    etable, cstat(_r_b) cstat(_r_ci) cstat(_r_p)
    collect layout (etable_depvar#stars[value]#coleq#colname) (result[_r_b _r_ci _r_p])
    Res.:

    Code:
    . etable, cstat(_r_b) cstat(_r_ci) cstat(_r_p)
    
    -----------------------------------------
                                   mpg       
    -----------------------------------------
    Weight (lbs.)                      -0.006
                           [-0.009    -0.003]
                                         0.00
    Displacement (cu. in.)              0.006
                           [-0.014     0.025]
                                         0.57
    Turn circle (ft.)                  -0.139
                           [-0.496     0.219]
                                         0.44
    Intercept                          43.588
                           [33.688    53.489]
                                         0.00
    Number of observations                 74
    -----------------------------------------
    
    . 
    . collect layout (etable_depvar#stars[value]#coleq#colname) (result[_r_b _r_ci _r_p])
    
    Collection: ETable
          Rows: etable_depvar#stars[value]#coleq#colname
       Columns: result[_r_b _r_ci _r_p]
       Table 1: 5 x 3
    
    -------------------------------------------------------
    mpg                                                    
      Weight (lbs.)          -0.006 [-0.009    -0.003] 0.00
      Displacement (cu. in.)  0.006 [-0.014     0.025] 0.57
      Turn circle (ft.)      -0.139 [-0.496     0.219] 0.44
      Intercept              43.588 [33.688    53.489] 0.00
    -------------------------------------------------------

    Comment


    • #3
      Thank you very much!! Happy New Year!!
      Can I name the columns, for example: Coefficient, 95% CI, pvalue?

      Comment


      • #4
        Code:
        sysuse auto, clear
        collect clear
        regress mpg weight disp turn
        etable, cstat(_r_b) cstat(_r_ci) cstat(_r_p)
        collect style header etable_depvar, level(hide)
        collect style header result[_r_b _r_ci _r_p], level(label)
        collect layout (etable_depvar#stars[value]#coleq#colname) (result[_r_b _r_ci _r_p])
        Res.:

        Code:
        . collect layout (etable_depvar#stars[value]#coleq#colname) (result[_r_b _r_ci _r_p])
        
        Collection: ETable
              Rows: etable_depvar#stars[value]#coleq#colname
           Columns: result[_r_b _r_ci _r_p]
           Table 1: 4 x 3
        
        -------------------------------------------------------------
                               Coefficient       95% CI       p-value
        -------------------------------------------------------------
        Weight (lbs.)               -0.006 [-0.009    -0.003]    0.00
        Displacement (cu. in.)       0.006 [-0.014     0.025]    0.57
        Turn circle (ft.)           -0.139 [-0.496     0.219]    0.44
        Intercept                   43.588 [33.688    53.489]    0.00
        -------------------------------------------------------------

        Comment

        Working...
        X