Creating tables in Stata using asdoc is super-easy. In this short post, I’ll show how to use asdoc to export Stata data to MS word files. If you have not already installed asdoc, it can be installed by

ssc install asdoc
For exporting values from the data files, we can use the sub-command list of asdoc. We can also make the command conditional using the in and if qualifiers. In the following example, let us use the auto data set from the system folders
sysuse auto, clear asdoc list price trunk mpg turn in 1/10 , replace

export Stata list output to MS Word with asdoc


In the above line of code, we first wrote the command asdoc and then the subcommand list. Next, we specified the names of the variables that we wanted to export to the Microsoft Word document. These variables were price, trunk, mpg, and turn. Then, we used the phrase in 1/10, which is the in qualifier, to report observations 1 to 10. The replace option will replace any existing output file with the name Myfile.doc.

  asdocx : Export Stata list to Excel, LaTeX, or HTML

asdocx is an enhanced version of asdoc. The list command in asdocx is even more powerful. You can export output from the Stata list command to Excel, Word, HTML, or LaTeX using asdocx. It’s label option allows to export both variable labels and values labels. You can use the Stata collapse command and then the asdocx sub-command tabdisp to create a two or three ways tables To know more differences between asdocx and asdoc, you may like to visit this page.