Announcement

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

  • Sorting the Order of Columns in esttab

    Dear all,


    I am creating a table for latex in Stata using esttab. I would like to maintain the table's order of columns from left to right in ascending order of the model numbers (e.g. m1 first on the left and m2 on the right). However, I end up with a table where m1 ends up being the second column, but mislabelled as m2 (see the output below).

    Is there a way to specify the order of columns that you would like in esttab?

    Thanks!


    Code:
    eststo clear
    
     eststo m1: quietly 
    
    qui: reg chrel mktchL
    
     
    eststo m2: quietly 
    
    qui: reg chsale mktchL chL lnas
    
     
     estout m1 m2, replace  
    
    --------------------------------------
                           m1           m2
                            b            b
    --------------------------------------
    mktchL          -.8120835    -.3627377
    chL              .1676934             
    lnas            -1.232935             
    _cons            -18.3429    -39.28699
    --------------------------------------

  • #2
    I have no idea what the double assignment of quietly does there. But if either take all the quietly out, or streamline as follows, then the order seems to be back to normal:

    Code:
    sysuse auto
    
    eststo clear
    
    eststo m1: quietly: reg mpg weight
    eststo m2: quietly: reg mpg weight price
    
    estout m1 m2

    Comment


    • #3
      Yep the poor use of quietly was the problem. My apologies.

      Resolved. Thank you for this!

      Comment


      • #4
        Hello, I am trying to export the regression table to a MS word and I am using this code which was working before but now it says that there is error file regression.rtf could not be opened
        r(603); I don't know how to fix this issue:
        Code:
        xtset CodeX year
         asreg AQ ESGCombinedScore SIZE_W GROWTH_W RETURNONASSETS_W MTB_W RDINT_W LEV_W CYCLE_W WGI , fmb
         estimates store FAMAandMACBETH
         
         esttab FAMAandMACBETH using regression.rtf, b t parentheses r2(%8.2f) ar2(%8.2f) replace nogap star(* 0.10 ** 0.05 *** 0.01) compress
         estimates clear

        Comment


        • #5
          Originally posted by Sally Ahmed View Post
          Hello, I am trying to export the regression table to a MS word and I am using this code which was working before but now it says that there is error file regression.rtf could not be opened
          r(603); I don't know how to fix this issue:
          Code:
          xtset CodeX year
          asreg AQ ESGCombinedScore SIZE_W GROWTH_W RETURNONASSETS_W MTB_W RDINT_W LEV_W CYCLE_W WGI , fmb
          estimates store FAMAandMACBETH
          
          esttab FAMAandMACBETH using regression.rtf, b t parentheses r2(%8.2f) ar2(%8.2f) replace nogap star(* 0.10 ** 0.05 *** 0.01) compress
          estimates clear
          Generally, the most common reason for this error is that the exported document is concurrently being opened in another software. So, try close that application you're using to open the regression.rtf, and try the Stata code again.

          Comment


          • #6
            Okay thank you so much Ken I tried also to change the working directory and it worked.

            Comment

            Working...
            X