asdoc: Export Stata dta file to MS Word

  • 5

asdoc: Export Stata dta file to MS Word


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




In the above line of code, we wrote asdoc and the sub-command list. After that, we specified the names of the variables that we wanted to export to the MS word document. These variables included price trunk mpg turn. After that, we used the phrase in 1/10, that is the in qualifier to report observation 1 to 10. The option replace will replace any existing output file with the name Myfile.doc



Dr.Shahzad Hussain

December 13, 2018at 10:48 am

AOA Sir,
I really appreciate your contribution toward the academic world

Faisal Khan

December 14, 2018at 11:42 am

Sir, Is this command allow as to assign title of table or title to file. As we have such option in outreg command. Similarly can we use append command if we need to expand a table.

Attaullah Shah

December 14, 2018at 11:47 am

Faisal Khan: Yes, asdoc allows title(), so the above code with title will look like

asdoc list price trunk mpg turn in 1/10 , replace title(Table 1: List of Variables) 

Kabir Ahmed

March 24, 2019at 8:32 pm

The command asdoc and other as*** is very helpful

    Attaullah Shah

    March 24, 2019at 11:09 pm

    Kabir Ahmed
    Thanks for your feedback. I hope you shall cite asdoc in your research.

Leave a Reply

5 × 4 =