Export correlation table to Word with stars and significance level using asdoc
Export correlation table to Word with stars and significance level using asdoc
The 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.
Thanks 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.
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.
Actually, 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 the star(all) option. In fact you are using star(.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, 2019 at 3:02 pm - Reply
Hello Sir,
First of all thanks for your valuable material about pwcorr which is available on internet. Actually I am using your command
The command star(all) is not working (option star() incorrectly specified)
Attaullah Shah
December 4, 2019 at 4:18 pm - Reply
Jadhav
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.
net install asdoc, from(http://fintechprofessor.com) replace
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.
Thanks for creating this function in Stata – so helpful! I have two questions.
First, when using asdoc pwcorr, is there code I can use to change the star significance levels? I’d like to make it:
*** p<0.001, ** p<0.01, * p<0.05
Second, is there any way to create a single table that combines the summary statistics and the correlation matrix? (And puts the results from asdoc sum and asdoc pwcorr in one table). I'd love to not have to format it by hand after the fact.
Dear Sir, I found corsp command for combined result for pearson correlation and spareman correlation. Can you please help me giving a direction how can I bring stars for this command. If I use star(all), it’s showing that star() not allowed. I will be really grateful. Thanks!
Maria Katsikani
September 7, 2021 at 12:45 am - Reply
Dear Sir,
Thank you very much about your advice. I installed the link you suggested in an earlier comment ; net install asdoc, from(http://fintechprofessor.com) replace
And so far I did these 2 stata entries;
asdoc pwcorr MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w if COUNTRY==1, star(all) nonum
asdoc pwcorr MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w if COUNTRY==2, star(all) nonum
(because I wanted one correlation table per country).
I would also like to adjust the command
by COUNTRY YEAR, sort : correlate MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w
in order to get a correlation table with 3 sets of significance stars for the 1st country for 2014, then for the 1st for 2015, for the 2nd country for 2014, etc(I examine the years 2014 – 2019 for France and Germany) .
I typed the command;
asdoc pwcorr by COUNTRY YEAR, sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
and also tried;
pwcorr by COUNTRY YEAR, asdoc sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
and
by COUNTRY YEAR, asdoc pwcorr sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
but none of these worked.
What can I do?
Thank you very much in advance.
Greedings from Greece
Attaullah Shah
September 24, 2021 at 3:27 pm - Reply
by() is not allowed with pwcorr. If you wish to estimate the command for each country, then use a loop, something like this
foreach c of countrya countryb … {
asdocx pwcorr … if country == “`c'”
}
I have a question regarding exporting pwcorr results with the asdoc command. I am using the following command to export my correlation results:
asdoc pwcorr CAR Dissent Post Volatility BM Leverage lag_ROA scaled_ESurprise log_proximity NBIM_Own, obs star(all)
I am using the ‘obs’ option and the results in Stata window show the number of observations for each pair. However, the Word output does not show the number of observations. Can you please explain why the Stata window results show the observations but the Word output does not?
THANK YOU for making it easy! I’ve been working with STATA for a year, and YOU just taught me how to do this!!!!
Amie
Thank you for your feedback. I will appreciate if you cite asdoc in your research.
Thanks 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.
Stars are not possible with corr command. You have to use pwcorr command.
Hello 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,
Camila
Actually, 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 the star(all) option. In fact you are using star(.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.
Hello 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?
Qurat 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.
Dear Prof. Shah, is there any way to produce a table combining Pearson and Spearman and output to excel?
With 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
Dear Prof.Attaullah Shah,
The command star(all) is not working (option star() incorrectly specified)
Jadhav
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.
Dear Prof.
its working. Thank you very much. ya we will cite asdoc.
Thank you
Thanks for creating this function in Stata – so helpful! I have two questions.
First, when using asdoc pwcorr, is there code I can use to change the star significance levels? I’d like to make it:
*** p<0.001, ** p<0.01, * p<0.05
Second, is there any way to create a single table that combines the summary statistics and the correlation matrix? (And puts the results from asdoc sum and asdoc pwcorr in one table). I'd love to not have to format it by hand after the fact.
Thank you!
Carly
As mentioned in this post, item 4 https://fintechprofessor.com/2018/12/19/asdoc-cutomizing-the-regression-output-ms-word-from-stata-confidence-interval-adding-stars-etc/, you can use the
setstars()
option to customize reporting of stars for statistical significance. And for combining the statistics and correlation table, I have already added this to the asdocx version, which is expected in a month’s time. I shall let all asdoc users once it is ready. For more on asdocx, you can visit this pagehttps://fintechprofessor.com/stata-programs/asdocx/
Dear Sir, I found corsp command for combined result for pearson correlation and spareman correlation. Can you please help me giving a direction how can I bring stars for this command. If I use star(all), it’s showing that star() not allowed. I will be really grateful. Thanks!
Dear Sir,
Thank you very much about your advice. I installed the link you suggested in an earlier comment ; net install asdoc, from(http://fintechprofessor.com) replace
And so far I did these 2 stata entries;
asdoc pwcorr MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w if COUNTRY==1, star(all) nonum
asdoc pwcorr MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w if COUNTRY==2, star(all) nonum
(because I wanted one correlation table per country).
I would also like to adjust the command
by COUNTRY YEAR, sort : correlate MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w
in order to get a correlation table with 3 sets of significance stars for the 1st country for 2014, then for the 1st for 2015, for the 2nd country for 2014, etc(I examine the years 2014 – 2019 for France and Germany) .
I typed the command;
asdoc pwcorr by COUNTRY YEAR, sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
and also tried;
pwcorr by COUNTRY YEAR, asdoc sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
and
by COUNTRY YEAR, asdoc pwcorr sort : MVtoSH_w ONEtoSH_w EARtoSH_w BVtoSH_w OCItoSH_w, star(all) nonum
but none of these worked.
What can I do?
Thank you very much in advance.
Greedings from Greece
by() is not allowed with pwcorr. If you wish to estimate the command for each country, then use a loop, something like this
foreach c of countrya countryb … {
asdocx pwcorr … if country == “`c'”
}
Dear Sir,
I have a question regarding exporting pwcorr results with the asdoc command. I am using the following command to export my correlation results:
asdoc pwcorr CAR Dissent Post Volatility BM Leverage lag_ROA scaled_ESurprise log_proximity NBIM_Own, obs star(all)
I am using the ‘obs’ option and the results in Stata window show the number of observations for each pair. However, the Word output does not show the number of observations. Can you please explain why the Stata window results show the observations but the Word output does not?
Dear Sir,
asdoc pwcorr CAR Dissent Post Volatility BM Leverage lag_ROA scaled_ESurprise log_proximity NBIM_Own, obs star(all)
Word output does not show the number of observations for each pair
Email me your sample data and code so that I can replicate the issue at my end.