## Export correlation table to Word with stars and significance level using asdoc

Category:UncategorizedThe updated version of asdoc can now create a table of correlation with significance levels starred at different levels. The new version can be installed by typing the following line in Stata.

### Installation of the new version

net install asdoc, from(http://fintechprofessor.com) replace

### An Example

sysuse auto, clear

asdoc pwcorr price mpg rep78 headroom trunk weight length turn , star(all) replace nonum

###

Explanation

Just like with any other Stata command, we would write asdoc as a prefix to the Stata command. In this case, the Stata command is pwcorr which is followed by the variable names. After the comma, we added option nonum, star(all) and replace. These are explained bellow:

**star(all)** = This option is used to report stars to signfy significance at different levels. These are: ***

- *** to show significance at 1% or bellow
- ** to show significance at 5% or bellow
- * to show significance at 10% or bellow

**nonum** = Without using this option, asdoc will report numeric numbers as column headers

**replace** = This option replaces any existing file

You would be interested in this blog entry where I show several useful options of asdoc that can be used with correlation tables.

## 13 Comments

## Amie

June 13, 2019at 6:33 amTHANK YOU for making it easy! I’ve been working with STATA for a year, and YOU just taught me how to do this!!!!

## Attaullah Shah

June 13, 2019at 12:07 pmAmie

Thank you for your feedback. I will appreciate if you cite asdoc in your research.

## Qurat ul Ain

June 22, 2019at 3:26 pmThanks a lot. I Need only simple help. I am using asdoc stata package and want to make simple correlation instead of pwcorr.

I have seen some comments on blogs about pwcorr and this command also provide the facility to add star woth results. But I want to add star using corr command.

Please help me how I can add star while using corr command.

Waiting for your kind response.

## Attaullah Shah

June 22, 2019at 3:27 pmStars are not possible with corr command. You have to use pwcorr command.

## Camila Brown

August 30, 2019at 5:18 pmHello Dr. Shah,

I am writing you since I am using your new beta version of your program asdoc in Stata, which I installed in my Stata 16 using:

net install asdoc, from(http://fintechprofessor.com) replace

What I do not understand is that even though I am setting star(0.01) and all

my correlation coefficients have 1 star only except for one coefficient which is

significant at 0.05 using:

asdoc pwcorr x1 x2 x3 x4…x14, star(0.01) replace

I am getting a correlation matrix with a note at the bottom saying:

***p<0.01, **p<0.05, *p<0.1

If all my correlation coefficients are significant at 0.01 except for one at 0.05 why each coefficient has * and the one at 0.05 has no star at all when I would expect all having *** and the one at 0.05 **?

I will appreciate if you can clarify to me what is going on with your new beta version. I hope you can respond my question.

Best regards,

## Attaullah Shah

August 30, 2019at 5:20 pmCamilaActually, the note at the end of the table

” ***p<0.01, **p<0.05, *p<0.1"is what creates the confusion. This note should appear only when we use thestar(all)option. In fact you are usingstar(.01)option which will produce a star only when the given correlation is significant at 1% level. I shall fix this message problem. If there is any further confusion, please feel free to contact.## Qurat ul Ain

September 10, 2019at 3:02 pmHello Sir,

First of all thanks for your valuable material about pwcorr which is available on internet. Actually I am using your command

asdoc pwcorr price mpg rep78 headroom trunk weight length turn , star(all) replace nonum

But I am not getting star for all significance level (1%, 5% and 10%). Instead of this If I add this option

star(0.01) then it gives answer for only one significance level. Is there any command in which we can get all significance levels?

## Attaullah Shah

September 10, 2019at 3:48 pmQurat ul Ain

Perhaps you are using some old version of asdoc.

The new version of asdoc can be installed from my site. Copy and paste the following line in Stata and press enter.

Please note that the above line has to be copied in full. After installation of the new version, then restart Stata.

## Lisa

November 1, 2019at 1:13 amDear Prof. Shah, is there any way to produce a table combining Pearson and Spearman and output to excel?

## Attaullah Shah

November 2, 2019at 12:34 pmWith the first svy code, you do not need the nest and replace options. Second, I have used the eform option with asdoc, that will report odd ratios

Jordan

## jadhav

December 4, 2019at 4:12 pmDear Prof.Attaullah Shah,

The command star(all) is not working (option star() incorrectly specified)

## Attaullah Shah

December 4, 2019at 4:18 pmJadhav

Please install the updated version of asdoc. The new version of asdoc can be installed from my site. Copy and paste the following line in Stata and press enter.

Please note that the above line has to be copied in full. After installation of the new version, then restart Stata.

Please do remember to cite asdoc. To cite:

In-text citation

Tables were created using asdoc, a Stata program written by Shah (2018).

Bibliography

Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.

## Jadhav

December 4, 2019at 5:13 pmDear Prof.

its working. Thank you very much. ya we will cite asdoc.

Thank you