Announcement

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

  • Issues with esttab command

    Hello everyone, this is my first time posting so hopefully I'm doing this the right way!

    I'm having some issues with the esttab command, mainly when I try to export my tables with this command it gives me a completely different table then the one that shows up on the results window when I store the same table with estout. I would also like to add that my goal is to replicate a table that contains descriptive statistics (only the mean).

    Here's the code I used:

    eststo Table1A: bysort YEAR: tabstat var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 var12 var13 var14 [aw=WTSSALL] if var15==1

    esttab Table1A using "$tables/table1A", cells("mean")

    Thanks for your help

  • #2
    estab does not work with tabstat. esttab is looking for e(*).

    try this:

    Code:
    sysuse auto, clear
    tabstat mpg weight length [aw=price] , by(foreign) save
    matrix R = r(Stat1) \ r(Stat2)
    asdoc wmat, matrix(R)

    Comment


    • #3
      Thank you so much for your help and your fast reply! I tried it and it works perfectly except it only shows me the means for two out of the three categories for the variable YEAR. I just have one last question, can I use a global in order to save the table in a particular file with the asdoc command?
      Last edited by Zaharija Porchu; 10 Nov 2023, 04:46.

      Comment


      • #4
        Code:
         
         sysuse auto, clear tabstat mpg weight length [aw=price] , by(foreign) save(Myfile.doc) replace matrix R = r(Stat1) \ r(Stat2) \ r(StatTotal) asdoc wmat, matrix(R)
        you can save to particular file names
        help asdoc

        Comment

        Working...
        X