How to export high-quality table of correlations from Stata to MS Word

  • 9

How to export high-quality table of correlations from Stata to MS Word

Category:asdoc Tags : 


For creating a high-quality publication-ready table of correlations from Stata output, we need to install asdoc program from SSC first.

ssc install asdoc, update

Once the installation is complete, we shall add the word asdoc to the cor or correlate command of Stata. Since we estimate correlations among all numeric variables of a dataset with just cor, we shall add asdoc as a prefix to the cor command. For our example, purposes, let us load the auto.dta data from the Stata example files.


Example 1: Make a table of correlation for all variables.

sysuse auto, clear
asdoc cor



Example 2: We can report variable labels instead of variable names

asdoc cor, label replace



Further, it is possible to write names of the variables in the column headings instead of sequential numbers. For this, we shall invoke the option nonum. Therefore, see example 3.


Example 3: Write variable names in column headers

sysuse auto, clear

asdoc pwcorr, nonum replace


Read also : 

Table of contents of asdoc

Generate correlation table with significance/stars

Generate a table of descriptive statistics







Zhang Huang

November 12, 2018at 2:48 pm

I can’t download asdoc from the stata. Can you help me and sent the asdoc.ado and asdoc.sthlp to me?
Thank you.

    Attaullah Shah

    November 12, 2018at 2:50 pm

    To download, type
    ssc install asdoc

    If you receive any error message, then please share that.

Zhang Huang

November 12, 2018at 2:53 pm

Sorry. It always replies like this in Stata:

ssc install asdoc, replace

checking asdoc consistency and verifying not already installed…
connection timed out -- see help r(2) for troubleshooting
could not copy
(no action taken)

I think maybe because I am in China, so the download action is defined.

Attaullah Shah

November 12, 2018at 2:55 pm

OK, copy the attached files to the mentioned directories

copy asdoc.ado and asdoc.sthlp to this folder


2. Copy the lasdoc.mlib to this folder


The last letter is L in small.


December 25, 2018at 5:44 pm

Hi Attaullah,

How can I get the star sign in the correlation number? Is it possible to get it using the asdoc command.

    Attaullah Shah

    December 25, 2018at 6:50 pm

    Simon: The significance stars can be reported using the sub-command pwcorr. For example

    sysuse auto
     asdoc pwcorr price headroom mpg displacement, star(.01) replace


December 28, 2018at 5:33 pm

Hi Attaullah,

Many thanks for your reply. can we get also 0.05 and 0.10. I have tried with the given code but it does not work.



    Attaullah Shah

    December 28, 2018at 6:55 pm

    Simon: Reporting stars for showing statistical significance at .05 or 0.1 level works the same way as shown above. For example,

    sysuse auto, clear
    * At 5% level
     asdoc pwcorr price headroom mpg displacement, star(.05) replace
    * At 10% level
     asdoc pwcorr price headroom mpg displacement, star(.1) replace


January 1, 2019at 6:11 pm

Many thanks Attaullah. I understand your point. But actually, my query was in one table, how we can generate all star sign for 0.1, 0.5, and 0.01. Similar like the correlation table published in the article. Sometimes, in one table, some variables may be significat at 1%, some at 5% and some at 10%.

Appreciate your help.

Thanks again.

Leave a Reply

twenty − two =