Announcement

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

  • How to have multiple tables in a single MS Word document using outreg2 command?

    Hello

    How do I obtain different regression output in different tables in a single MS Word document using the outreg2 command?

    I know only about the append option which saves the different regression output in single table. However, I want the regression output in different tables in the same MS word document.

    thanks,

    Sagnik

  • #2

    Hey Sagnik,

    I think the simplest solution would be to generate specific .rtf documents for each regression after using the outreg command.

    this will save you the hassle of copy pasting and provide your with specific regression output not appended , but seperate


    regards,

    Wes





    Comment


    • #3
      Thanks

      Comment


      • #4
        asdoc (from SSC) supports writing results of different Stata outputs to the same file including regressions. I think you are interested in nested regression tables. In the following examples, I would write three regressions to Table 1 and then another three regressions to Table 2 in the same file. The example dataset is auto data. For exploring more capabilities of asdoc, you can read Statalist blog here for version 1 of asdoc and here for version 2.0 of asdoc. You can also read this short post on quick start with asdoc.
        Code:
        * install asdoc
        ssc install asdoc
        
        * load the auto data set
        sysuse auto
        
        *Make a nested table where the dependent variable is price and independent variables are mpg rep78
          asdoc reg price mpg rep78, nest replace
        
        * Add variable headroom and then nest with existing table
          asdoc reg price mpg rep78 headroom, nest
        
        *   Add variable weight and then nest with existing table
             asdoc reg price mpg rep78 headroom weight, nest
        Add another table of regression in the same file
        This time our dependent variable is displacement. Please note that we shall use the option reset, which will start a new regression table in the file.

        Code:
          asdoc reg displacement mpg rep78, nest reset
        
          asdoc reg displacement mpg rep78 headroom, nest
        
         asdoc reg displacement mpg rep78 headroom weight, nest
        The output table is given below.
        Click image for larger version

Name:	asdoc reset.png
Views:	1
Size:	29.5 KB
ID:	1463441



        You can continue writing other statistics to this file. For more details, you can watch this YouTube video on how to write different statistics to the same file.
        Last edited by Attaullah Shah; 25 Sep 2018, 11:17.
        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


        • #5
          I figured out how to use it with outreg. It has an option called addtable. But I can't seem to get the option to work right. It replaces my first table. Anyone used outreg, addtable?

          Comment


          • #6
            Originally posted by Sagnik Bagchi View Post
            Thanks
            but it doesn't add a new table next to existing one. Is there any option like addtable in outreg2 to add new table, and label option also doesn't report value label for the variable
            Best regards,
            Mukesh

            (Stata 15.1 SE)

            Comment

            Working...
            X