This post covers how to export Stata results tables to a Word file with using putdocx command.
1. Preparation
For a demonstration, we will use 'auto' dataset that Stata provides .
sysuse auto.dta
2. Demonstration 1 - One table
The following set of syntax will make a Word file.
putdocx begin *syntax for analysis reg price mpg weight length i.foreign putdocx table Table1=etable *Designating the file name putdocx save "file_1"
The file directory where the Word file is saved will be shown among the results section.
In my case, the file is saved in the 'Document' folder.

3. Demonstration 2 - Multiple tables
We can also put multiple tables in a single Word file.
For example, we will export three tables.
putdocx begin *analysis syntax 1 reg price mpg weight length i.foreign putdocx table Table1=etable *analysis syntax 2 reg price mpg weight length putdocx table Table1=etable *analysis syntax 3 reg price weight length putdocx table Table1=etable *Designating the file name putdocx save "file_2"
Another option is to reapeat the set of syntax in Demonstration 1 with changing the analysis syntax and the file name, but this will make multiple Word files.
For a more detailed guideline, refer to the link below.

![[R] Data Import](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5c_zi7m6ac3-R1bYIJyT3W6OQT7hc_EM4VLG7AGHx4KTh34WM1TNnGdU5Ft1mTclDmN1_U91hHixDjM1FFnGa8bZYnpykFWAMGv_EBKXyrWWjrPcxOc25YzY50igIPuznUsEyWRlvjKJpbO6EOCAn3GPlHE3wg2QSOLiqbkLfUazVALtPSH93WE3CTw/w72-h72-p-k-no-nu/mika-baumeister-Wpnoqo2plFA-unsplash.jpg) 
0 Comments