Announcement

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

  • Multiple Regression Tables into a Single Word File (using outreg2 and/or esttab)

    Dear Statalisters,

    I wish to write a new table below an existing table so that I can export multiple regression tables into a single Word file.


    For example, I create this regression table:

    Code:
    sysuse auto
    reg price headroom
    outreg2 using "Regression.doc"
    
    reg price headroom turn
    outreg2 using "Regression.doc", append

    Then I create another regression table:

    Code:
    reg mpg price headroom
    outreg2 using "Regression2.doc"
    
    reg mpg price headroom turn
    outreg2 using "Regression2.doc", append

    These two regression tables are currently written to separate documents. However, I wish to write them to the same document.
    Does anyone know how to write multiple regression tables into a single Word document using outreg2 or esttab?


    Thank you for any help you can offer.

    Kind regards,

    Eline





  • #2
    You can use asdoc for writing multiple regression tables to the same document. asdoc can be downloaded from SSC and can be used with almost all Stata commands. Here is a short blog post that shows how asdoc can be used with any Stata command. You can also watch several YouTube videos that show the use of asdoc

    * Install asdoc
    Code:
    ssc install asdoc, replace
    Please note that I am using the nest option of asdoc in the following example. There are two other options to report regression output, they are (1) detailed regressions, which is the default in asdoc (2) wide regressions, which can be invoked by using the option wide. You can see further details on these in the help file of asdoc

    Code:
    asdoc reg price headroom, nest save(Regression) replace
    
    asdoc reg price headroom turn, nest save(Regression)
    
    * Please note that option append is optional in asdoc, without
    * option replace, all additional output is appended to the file
    
    * Now start a new table by using the option reset
    
    asdoc reg mpg price headroom, nest save(Regression) reset
    asdoc reg mpg price headroom turn, nest save(Regression)
    Click image for larger version

Name:	reg2.png
Views:	1
Size:	33.8 KB
ID:	1481134
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Hello, I tried the above with "sysuse auto" data set. The option reset is not working.

      Comment


      • #4
        Thanks for your post. Let me check, something might be interfering with the reset option in the recent updates.
        Regards
        --------------------------------------------------
        Attaullah Shah, PhD.
        Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
        FinTechProfessor.com
        https://asdocx.com
        Check out my asdoc program, which sends outputs to MS Word.
        For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

        Comment

        Working...
        X