Announcement

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

  • Can esstab outputs both se, t and p at the same time?

    In esttab help file, it can only output se or t or p value once a time, If i want them in one table, is there any for loop code can do this? The table is like this:
    Click image for larger version

Name:	WX20230605-231636@2x.png
Views:	1
Size:	15.2 KB
ID:	1716112

    Thanks.

  • #2
    estout is from SSC (FAQ Advice #12). Look at the -cells()- option. There are plenty of examples in the forum if you search.

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      estout is from SSC (FAQ Advice #12). Look at the -cells()- option. There are plenty of examples in the forum if you search.
      Thank you so much!

      Comment


      • #4
        Code:
        sysuse auto, clear
        regress price mpg weight
        esttab, cells("b se t p") drop(_cons)  nonumb label mlab(none) collab(coef SE t p-val)
        Res.:

        Code:
        . esttab, cells("b se t p") drop(_cons) nonumb label mlab(none) collab(coef SE t p-val)
        
        ------------------------------------------------------------------------
                                     coef           SE            t        p-val
        ------------------------------------------------------------------------
        Mileage (mpg)           -49.51222     86.15604    -.5746808     .5673237
        Weight (lbs.)            1.746559     .6413538     2.723238     .0081298
        ------------------------------------------------------------------------
        Observations                   74                                      
        ------------------------------------------------------------------------
        or some variation of this:

        Code:
        sysuse auto, clear
        regress price mpg weight
        esttab, cells("b(star) t p" se(par)) drop(_cons)  nonumb ///
        label mlab(none) collab(coef t p-val) ///
        starlevels(* 0.1 ** 0.05 *** 0.01) ///
        addnote("Standard errors in parentheses")
        Res.:

        Code:
        . esttab, cells("b(star) t p" se(par)) drop(_cons)  nonumb ///
        > label mlab(none) collab(coef t p-val) ///
        > starlevels(* 0.1 ** 0.05 *** 0.01) ///
        > addnote("Standard errors in parentheses")
        
        --------------------------------------------------------------
                                     coef               t        p-val
        --------------------------------------------------------------
        Mileage (mpg)           -49.51222       -.5746808     .5673237
                               (86.15604)                             
        Weight (lbs.)            1.746559***     2.723238     .0081298
                               (.6413538)                             
        --------------------------------------------------------------
        Observations                   74                             
        --------------------------------------------------------------
        Standard errors in parentheses

        Comment

        Working...
        X