Using asdoc is pretty easy. You need to add just asdoc as a prefix to Stata commands. For example, we use the sum command to find summary statistics of all numeric variables in the dataset. We shall add just asdoc as a prefix to sum.  Let us load the auto.dta set for practice and find summary stats of all numeric variables and send the output to MS Word with asdoc

sysuse auto
asdoc sum

And voila, a beautiful table of the descriptive statistic is ready [click here to see it].

And for creating a table of correlations among all numerical variables, we shall just type asdoc cor. If we were to append the results to the same file, we shall add append after the comma or leave it (append is the default, we  can use replace to replace the existing file)

asdoc cor
OR 
asdoc cor, append

More on asdoc

See also the following resources related to asdoc.

YouTube Video: Descriptive / Summary Statistics from Stata in Word with asdoc

YouTube Video: Create a publication quality table of correlation in Stata with asdoc

YouTube Video: Writing all statistics to a single Word file from Stata with asdoc

YouTube Video: Create publication quality regression tables in Stata with asdoc

See a Table of Contents that shows what else asdoc can do

65 Comments

  1. Julia Schmidt May 22, 2018 at 11:20 am - Reply

    This is such a useful program, it saved a lot of my time. A great breakthrough for all Stata users.

  2. Dr. Yasir Bin Tariq May 28, 2018 at 3:57 pm - Reply

    Thank you very much. I must tell you this asdoc program has made getting output from STATA very easy. You are a an academic Saint ❤ 😍

  3. Alberto Otete June 19, 2018 at 2:59 pm - Reply

    I have used asdoc sum, with very good tables in Word. I have thus learnt from this forum.

  4. Myo Win June 19, 2018 at 2:59 pm - Reply

    Thank you very much Attaullah Shah. asdoc command can create summarize table, corr table and regression tables easily in words doc. This command safe my time a lot.

  5. HCB August 21, 2018 at 4:33 pm - Reply

    Thank you. This is completely genius and I was able to create descriptive tables in a few clicks. Saved so much time.

    Can asdoc be used with imputed logistical regression as well?

    • Attaullah Shah August 26, 2018 at 10:45 am - Reply

      Dear HCB, Thanks for your comments. Can you please provide an example data set and the format in which results are required. I will look into the possibility of doing it with the current version of asdoc. If not available in the current version, I will consider it for the next version

  6. Poe Bitra August 26, 2018 at 10:55 am - Reply

    Firstly, I would like to thank you for the wonderful ASDOC package for Stata! It has been a tremendous help in my studies and it made me think about contributing to the Stata community when I have better understanding of the field.

    Recently I have updated the package and the commands “asdoc, cells” no longer work. This is why I wondered if there were any big changes to the code and whether I could retrieve an earlier version of the asdoc.ado file. Thank you in advance!

    • Attaullah Shah August 26, 2018 at 10:58 am - Reply

      Dear Poe
      Thanks for the kind words. Version 2 of asdoc is not yet out for public testing. Perhaps you updated it from my website where I upload only trial versions for testing. Recently, I replaced option cell with the option row. Try option row instead of cells and tell me whether it solves the issu. Please do cite asdoc in your research.

  7. Suman Kanougiya September 14, 2018 at 4:23 pm - Reply

    Dear Attaullah,

    The asdoc command is indeed very useful. But, I get two different results with and without asdoc commnad.

    e.g

    asdoc pwcorr gcl_avg_od sural_latency sural_duration sural_amplitude sural_ncvif group==1, star(0.05) sig

    and

     pwcorr gcl_avg_od sural_latency sural_duration sural_amplitude sural_ncvif group==1, star(0.05) sig

    Would you please guide me what have I been doing wrong?

  8. Attaullah Shah September 14, 2018 at 5:22 pm - Reply

    Dear Suman Kanougiya
    Thanks for pointing this out. Yes, there was an omission of adding if condition in the asdoc code for pwcor command. I have corrected it and shall send version 2.1 soon to SSC.
    In the meanwhile, you can do the following to get correct results

    preserve
    keep if  group == 1
    asdoc pwcorr gcl_avg_od sural_latency sural_duration sural_amplitude sural_ncv, star (0.05) 
    restore
  9. Matthew Millard September 22, 2018 at 2:18 am - Reply

    I have been telling everyone about the asdoc package who uses Stata. Several people told me how much they absolutely love it. One’s exact words were that it is “game changing” for convenience.

  10. Sumeet Malik October 3, 2018 at 1:52 pm - Reply

    I came across your website through the youtube videos on ASDOC programme, which I think is very helpful and exponentially better than the OUTREG programme. If you could include p-values instead of stars, it would make the program even more useful since some of the top management journals now don’t want the asterisks in the tables.

    • Attaullah Shah October 10, 2018 at 12:03 am - Reply

      Dear Sumeet Malik
      That is on my agenda for the next update. Thanks for your suggestion.

  11. Jannik Helweg-Larsen October 10, 2018 at 12:06 am - Reply

    Such a brilliant and extremely useful and most impressive Stata program!

  12. Terence October 18, 2018 at 10:45 am - Reply

    This is wonderful. Thank you!

  13. Million Tadesse October 19, 2018 at 4:28 am - Reply

    Excellent command, asdoc!. Almost ten years ago (approximate) I asked Prof Baum of esttab estout etc author if he can do the same for descriptive stat. results be exported to word. Now time has come! I just started using STATA again (more frequently) with lots of change (in STATA 15).

  14. Million Tadesse October 25, 2018 at 11:58 pm - Reply

    Looking more options after regress command with asdoc. Example, Age as “Age in years” as we used to do in estout command after regress. Estout has several other options. Where are those with asdoc after regress? Sorry if I missed your posts.

  15. Attaullah Shah October 26, 2018 at 12:09 am - Reply

    Million Tadesse: Thanks for your comments. I would need some details on what are you proposing. Do you mean to append additional statistics to the regression table? The default option in asdoc for outputting regression tables is the detailed regression type, and there asdoc produces some additional statistics such as the mean of the dependent variables, the standard deviation of the dependent variable etc. In the nested tables, these statistics are not reported. I would appreciate if you give a link to any table that you have in mind for asdoc or email me some examples at attaullah.shah@imsciences.edu.pk

  16. Nicola Deghaye October 26, 2018 at 4:20 pm - Reply

    I have installed your new asdoc code. Thanks – it looks very promising.I am having a challenge using it with tabstat. Here is the code:

    asdoc tabstat lang_perc_original, stat (N mean median sem)

    This is what I get:

                 |      mean 
    -------------+-----------
    lang_perc_~l |  31.71514 
      31.715
    

    I am getting the mean, not the other stats. Here is what it should look like:

    tabstat  lang_perc_original, stat (mean median sem)
    
        variable |      mean       p50  se(mean)
    -------------+------------------------------
    lang_perc_~l |  31.71514  27.77778  .1461791
    --------------------------------------------
    

    I have tried a lot of different ways of writing the code, but keep getting the same thing.

    • Attaullah Shah October 26, 2018 at 4:24 pm - Reply

      Dear Nicola Deghaye
      There are two issues with your code. First, there is a space between stat and (N mean median sem). This space should not exist. Second, the allowed statistics is semean, not sem. So the correct code would be

      asdoc tabstat lang_perc_original, stat(N mean median semean)

      Please do tell me whether the problem you are referring to is solved?

  17. Nicola Deghaye October 29, 2018 at 10:02 pm - Reply

    Thank you so much! I am new at this and these little things trip me up so often. Thanks for taking the time to respond and for the great new code

  18. Million Tadesse November 6, 2018 at 11:28 am - Reply

    Dear Dr Shah,
    This is a follow up of my question on your website pasted below.

    I was wondering for “varlabel” option to get my dummy variables (e.g. 2.Farmtyp, etc as shown above) shown in full:

    Fruit crops instead of 2.farmtyp as shown above.

    As you know esttab command has the capacity to write this variable in full.
    Example:

    regress y x1 x2
    estimate store m1
    regress z x1 x3
    estimate store m2
    
    esttab m1 m2,replace drop ("_age") cells(b(star fmt(3)) bla bla 

    legend varlabels(_cons Constant CR “Access to credit”, etc etc. basically all variables in short form can be written in full here.

    So I am missing lots of useful options with asdoc for a regress command. Can we store estimates as in the above example (m1 m2) and run/display them as in esttab command?
    Thanks for the excellent work on asdoc.

     benfpaid

     Coef.

     St.Err

     t-value

     p-value

     Sig.

    AccruaAllowRevn

    -0.149

    0.016

    -9.60

    0.000

    ***

    AccruaAllowExpn

    0.151

    0.019

    7.97

    0.000

    ***

    RML

    0.066

    0.009

    7.18

    0.000

    ***

    1b.Farmtyp

    0.000

    .

    .

    .

     

    2.Farmtyp

    -11600.000

    3456.754

    -3.36

    0.001

    ***

    3.Farmtyp

    94.207

    8363.845

    0.01

    0.991

     

    4.Farmtyp

    -52600.000

    14660.636

    -3.59

    0.000

    ***

    5.Farmtyp

    -3761.678

    13938.630

    -0.27

    0.787

     

    7.Farmtyp

    -33400.000

    8160.412

    -4.10

    0.000

    ***

    8.Farmtyp

    -44600.000

    16514.566

    -2.70

    0.007

    ***

    9.Farmtyp

    74530.888

    8088.643

    9.21

    0.000

    ***

    10.Farmtyp

    5177.118

    20400.808

    0.25

    0.800

     

    11.Farmtyp

    -18500.000

    13459.766

    -1.37

    0.170

     

    12.Farmtyp

    -17700.000

    7798.791

    -2.27

    0.024

    **

    _cons

    17447.843

    2836.525

    6.15

    0.000

    ***

     

    Mean dependent var

    21275.009

    SD dependent var

    61990.793

    R-squared

    0.381

    Number of obs 

    1142.000

    F-test 

    53.366

    Prob > F

    0.000

    Akaike crit. (AIC)

    27923.777

    Bayesian crit. (BIC)

    27994.344

     

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

    Note that I did not read everything on asdoc yet. Sorry if you already answered this.

    • Attaullah Shah November 6, 2018 at 11:47 am - Reply

      Million Tadesse: Thanks for the detailed reply. If I have correctly understood your point, you want to show variable labels instead of variable names. In the recent release of asdoc, I have added the option label, that will show variable labels instead of variable names. For example, see the two regressions

      Reporting variable names

      asdoc reg price mpg rep78 headroom, replace

      Reporting variable labels

      asdoc reg price mpg rep78 headroom, label

      For the factor variables, you are right the option label does not work yet, and I have noted your suggestion. Since you said you have not read the asdoc help file yet, I would recommend exploring three important options that can be used with asdoc.

      Detailed regression (default)
      Nested regressions
      Wide regressions
      These are discussed with examples in post 38 on this thread on Statalist https://www.statalist.org/forums/forum/general-stata-discussion/general/1435798-asdoc-an-easy-way-of-creating-publication-quality-tables-from-stata-commands/page3

  19. Scandinaven November 21, 2018 at 11:11 pm - Reply

    Dear Professor

    Thank you so much for a great program for Stata. We are currently having big problems with Nordic characters such äöå when using label outputs. Is it something you are planning to remediate?

    • Attaullah Shah November 21, 2018 at 11:17 pm - Reply

      Scandinaven: I replied to a similar query on Statalist here – posts 45-46, where Chen Samulsion asked about the possibility of passing Chines characters from Stata to a Word file using asdoc. My reply was that getting Chinese characters in an RTF file is a pain in the neck. Usually, getting Chinese characters programmatically into an RTF file does not seem straightforward, one has to first convert the letters to Unicode and then render it properly in the RTF file.
      I think similar is the case with Nordic characters. Right now, I am struggling with finding a way out.

  20. Mior Faizmie Bin Yusof Za Ba December 4, 2018 at 8:28 pm - Reply

    Dear Attaullah Shah,
    Thank you for stata command. May Allah bless you here and hereafter.

  21. Daniel January 12, 2019 at 6:21 pm - Reply

    Dear Attaullah Shah,
    Im having issues with displaying several significance level in my pwcorr table with asdoc command. Is there any way to display more than 5% sig level, e.g. sig under 1%, 10% etc.?
    Secondly, even under 5%, asdoc command is giving me wrong results such as 0.3036* (this p-value is not under 5% yet asdoc in the output table shows me the star with 0.3036) .. ? the current command im using is as follow:

    asdoc pwcorr Depvar var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11, star (0.05) dec(2)

    Where am I going wrong ? Would appreciate your input on this matter. Many thanks!

    • Attaullah Shah January 12, 2019 at 6:30 pm - Reply

      Daniel
      asdoc just reproduces the output from the Stata official pwcorr command. Hence, it does not offer additional options. Since pwcorr command supports one level of significance, asdoc has the same capability.
      Concerning the error you are referring to, I would be interested in seeing the actual data. Can you email me that? It is unlikely, though, that asdoc will report incorrect results as it reports the results of pwcorr command directly to MS Word. Any error thereof would belong to pwcorr, not asdoc.

      From your text, it seems you are referring to the correlation coefficient of .306 as the p-value? If I am right, then you are not correctly interpreting the results of pwcorr. The numeric part of the text is actually the correlation coefficient, not the p-value. The p-values are denoted by the asterisk.

  22. Linn Gjersing February 1, 2019 at 2:56 pm - Reply

    I have to agree this is a great program. However, I run into issues when I run the asdoc command several times. This means that I would like to look a the table before I run the following command. I close the word doc in between. However, after a few times, I receive an error message and I am unable to use the asdoc command again.

    e.g:

    asdoc tabstat el, stats(p50 min max mean sd)
    asdoc tabstat el , stats(N p50 min max) by(aglk_)
    asdoc tabstat el , stats(N p50 min max) by(aaglk_)
    asdoc tabstat el , stats(N p50 min max) by(lk_)

    Up until the second last command, I am able to open the file mydocument. I close this document and run the final command.
    And I receive the following error message:

    asdoctable():  3301  subscript invalid
                     :     -  function returned error
    r(3301);

    If you or anyone else have any suggestions for how to solve this issue, I would be very greatful!!

    • Attaullah Shah February 1, 2019 at 4:47 pm - Reply

      Linn Gjersing
      Thanks for your kind words. I have just uploaded an updated version to SSC. Please download it and try it. I hope it will solve the problem you are referring to. To download,

      ssc install asdoc, replace

      If the new version still does not solve the problem, then I would appreciate if you can email the following info:
      1. Please type the following code in Stata and email me the output generated by it: Email: attaullah.shah@imsciences.edu.pk

      which asdoc

      2. Which Operating system are you using?
      3. Can you please send me actual or example data set that generated the error.
      Thanks for your cooperation.

  23. Cydney May 14, 2019 at 1:36 pm - Reply

    Fantastic program, I have been looking for a way to read results into a file for a while now and this is by far the best!
    However, I am trying to use the GLM command to get Risk Ratio’s and noticed that the eform option in the command doesn’t seem to work when asdoc is being used? I was wondering if this is a bug or if I am just trying to do something that cant be done?

    Thanks in advance 🙂

  24. Attaullah Shah May 14, 2019 at 2:55 pm - Reply

    Cydney
    Thanks for your kind words and reporting this bug. I shall explore the issue and let you know.

  25. Scandinaven May 16, 2019 at 1:43 pm - Reply

    Dear Professor

    What about using the code: unicode convertfile oldfile.doc newfile.doc, dstencoding(Windows-1252) replace
    in order to solve the unicode problem?

    • Attaullah Shah May 16, 2019 at 9:36 pm - Reply

      Scandinaven
      Have you tried your suggested solution and did it work? If yes, we would be much interest in a full example having some data, asdoc code, and your final solution.

  26. Stephen Okiya May 17, 2019 at 11:05 pm - Reply

    Dear Dr. Attaullah Shah,

    Hope this email finds you well.

    First, I would want to thank you for the great efforts in coming up with asdoc command. This is one of the powerful tools in Stata and responds to a greater need in analysis today.

    I am wondering if there’s an option for modifying the title of the table. In other words, rather than the default title “Tabulation of rep78” one can either have the variable label or a customized text.

    Thanks so much in advance!

    • Attaullah Shah May 18, 2019 at 1:59 am - Reply

      Stephen Okiya

      Thanks for your email and kind words. You can change the title of any table. To give a detailed reply to your question, I have just posted a blog entry on my website. You can access that here https://fintechprofessor.com/2019/05/17/asdoc-custom-table-title-ms-word-stata/

      I would appreciate if you cite asdoc in your research.

      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
      .

  27. wira coy July 14, 2019 at 7:22 am - Reply

    I got some error when using asdoc, it said–> Myfile.doc could not be opened, i’m using stata 14. thanks

    • Attaullah Shah July 15, 2019 at 2:24 am - Reply

      Wira Coy
      You have not provided enough details to know the source of the problem. Can you please share:
      1. The Stata code that you used with asdoc
      2. An Example dataset that is causing the error.
      3. Which operating system are you using? I mean Windows or macOS?
      You can share the above with email attaullah.shah@imsciences.edu.pk

  28. Ram Ashish August 15, 2019 at 5:55 pm - Reply

    How can I get the one way table without cumulative percentage with asdoc?

    • Attaullah Shah August 16, 2019 at 12:41 am - Reply

      Ram Ashish
      On your request, I have added the nocf option to asdoc. Now with this option, asdoc will not report the cumulative frequencies column. Here is an example:

      sysuse auto
      asdoc tab rep78 , replace nocf

      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.

  29. Rajesh September 17, 2019 at 5:35 pm - Reply

    Hello Professor,
    Do you have a list of all the programs written for generating descriptive and inferential statistics in one document? Thanks for the help.

  30. Shaazil September 24, 2019 at 10:08 pm - Reply

    hello Dr. Shah
    I have panel data, I want summary statistic by year and industry but the Stata gives an error when I enter the following command. it only runs when i choose one of them either year or industry:

    bys inds_code year: asdoc sum rdiffkth2, replace dec(4) ///
    stat(N mean p50 p25 p75 min max skewness kurtosis )

    number of variables in varlist must equal number of variables in generate(newvarlist)
    r(198);

    • Attaullah Shah September 24, 2019 at 10:28 pm - Reply

      Currently, asdoc allows bysort prefix with only one variable. If you need to use two variables with bysort, then there is a workaround. Convert both the variables to a single variable using the group function of egen, and then use the new variable with asdoc. See this example

      egen ind_year = group(inds_code year)
      
      bys ind_year: asdoc sum rdiffkth2, replace dec(4) ///
      stat(N mean p50 p25 p75 min max skewness kurtosis) replace

      Please cite asdoc in your research.

      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.

  31. Moses November 26, 2019 at 3:32 pm - Reply

    Thanks a trillion times! Is there a way we can specify the name of the table other than Myfile ?

    • Attaullah Shah November 26, 2019 at 10:55 pm - Reply

      Moses
      Yes, you can use option save(). For example,

      asdoc sum, save(Summary Statistics.doc)
  32. Monica November 29, 2019 at 8:42 pm - Reply

    Good afternoon Professor.
    I have been using your command and worked perfectly, but now does not work any more. I dont know what happened.

    Those are my commands:

    net install asdoc, from(http://fintechprofessor.com) replace
    
    asdoc, row( \i, Low, \i, High, \i) title(Summary Statistics) save(myfile) replace
    asdoc, row( \i, N=xxx, \i, N=xxx, \i)
    asdoc, row( \i, \i, \i, \i, \i, \i)
    asdoc, row( \i, Mean, SD, Mean, SD)
    asdoc, row( \i, \i, \i, \i, \i, \i) append    
    
    And the error:
    . asdoc, row( \i, Low, \i, High, \i) title(Summary Statistics) save(myfile) replace
              sparse_table():  3499  ustrrtrim() not found
                     :     -  function returned error

    Thank you for your help

    • Attaullah Shah November 30, 2019 at 7:47 am - Reply

      Monica
      I think you are using some older versions of Stata. Please tell me the Stata version and I shall add support for this.

  33. Monica December 1, 2019 at 3:05 pm - Reply

    Hi Professor.

    I am using Stata SE 16 (64bit).
    It is strange because some weeks ago that worked perfectly and then suddenly this error appeared.

    Thank you very much.

    Kind regards,
    Monica

    • Attaullah Shah December 4, 2019 at 10:33 pm - Reply

      Monica
      The problem was caused by one of the latest Stata function ustrrtrim() which was not available in Stata 11. I use Stata 11 to compile the code and this is why the function was never compiled. I have now used an alternative function and the row() option works fine as before.

  34. GSingh December 3, 2019 at 4:28 pm - Reply

    I am having trouble using asdoc within a loop that has nested regressions. Appreciate your help.

    local var_SHG_Part="a1 a2"
    
    foreach x in `var_SHG_Part' {
    asdoc areg `x' status, absorb(blid_2011) nest reset save(Regression Results.doc) append
    asdoc areg `x' status if w_curr_member==1, absorb(blid_2011) nest save(Regression Results_Bihar.doc) append
    }
    

    When the variable list has just one variable the nested output is fine but with multiple variables I don’t get the table. Instead I get characters like

     {\b\qc\line Table : Regression results }{\par}
    {\trowd\trgaph108\trleft-108
    \clbrdrt\brdrw10\brdrs   \cellx2000
    \fs20\pard\intbl\qc { }\cell
    \clbrdrt\brdrw10\brdrs   \cellx3250
    \fs20\pard\intbl\qc {(1)}\cell
    \clbrdrt\brdrw10\brdrs   \cellx4450 
    • Attaullah Shah December 3, 2019 at 6:21 pm - Reply

      GSingh
      remove the reset option from the table. Option reset should be used only when you have already created a table in a document and now want to make another table.

  35. Monica December 5, 2019 at 1:37 pm - Reply

    Thank you very much! Now it works perfectly again! 🙂

    Have a nice day.

    Monica

  36. Elena Herold January 9, 2020 at 9:07 pm - Reply

    Dear Professor,

    i have been using your command frequently and I find it very helpful.
    However, I had some issues using it today.

    i want to use the command:
    “asdoc tabstat income1 income2, by(group) statistics(sum) ”

    But Stata tells me “value label group not found”

    The code works with other variables instead of “group” such as gender or country.
    The variable group does however exist as the command works out perfectly when I leave out the “asdic” part.

    Kind regards,
    Elena

    • Attaullah Shah January 10, 2020 at 5:59 pm - Reply

      Please install the latest version. 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.

      If the latest version does not solve the problem, then please send an example data and the code that reproduce the error.
      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.

  37. Kabka January 17, 2020 at 3:20 pm - Reply

    hello, thanks for the grat code?
    how can i save multiple tables? after saving the first myfile stata says “file Myfile.doc already exists

       fopen():   602  file already exists
                 rtf_maker():     -  function returned error
                     :     -  function returned error"

    thank you!

    • Attaullah Shah January 18, 2020 at 10:26 am - Reply

      Kabka
      Can you please post the code that generates the above error?

  38. Junaidda February 3, 2020 at 7:45 am - Reply

    Hi, I am trying to transfer the correlation matrix table using asdoc, however, the following error appears

         rtf_maker():  3301  subscript invalid
                     :     -  function returned error
    r(3301);

    I have no problem to transfer the file for regression output. Only on correlation having such problem

    • Attaullah Shah February 3, 2020 at 8:39 am - Reply

      I just tried the following code and works without any error message

      sysuse auto, clear
      asdoc cor, replace

      To replicate your problem, please post the exact code that you have typed in Stata. Please also update asdoc by

      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.

  39. Prerak June 22, 2020 at 9:59 pm - Reply

    While exporting using “asdoc table x y, c(mean z) row save(results)” values are getting rounded off, I want values that are shown on the output window. what should I do?

    • Attaullah Shah June 23, 2020 at 10:30 am - Reply

      Prerak
      You can use option dec() to control the number of decimal points. See these examples

      Default: three decimal points

      sysuse auto
      asdoc table foreign rep78, c(mean price)

      Two decimal points

      sysuse auto
      asdoc table foreign rep78, c(mean price) dec(2)

      One decimal point

      sysuse auto
      asdoc table foreign rep78, c(mean price) dec(1)
  40. Nick June 25, 2020 at 8:07 pm - Reply

    Hi Professor,

    Thank you for the program, really amazing work.

    I have an issue with exporting the following correlation matrix to Word:

    asdoc pwcorr Bar_downsizing Bar_brexit Bar_financialissues ///
    Bar_financialissuesonlysov Bar_futureoutlook Bar_generalissues Bar_generalissuesonlysov ///
     Bar_humanaccidents Bar_humanaccidentsonlysov Bar_internalwrongdoing Bar_labourproblems ///
     Bar_naturaldisasters Bar_naturaldisastersonlysov Bar_operationalrisk Bar_pandemics ///
     Bar_sanctions Bar_strategicproblems Bar_posfutureoutlookonlysov Bar_posfinancialonlysov ///
     Bar_positive Bar_positiveonlysov Bar_strategicrisk, star(all) nonum

    it gives the following error message:

       rtf_maker():  3301  subscript invalid
                     :     -  function returned error
    r(3301);

    In previous messages I saw a comment to reinstall this:

     ssc install asdoc, replace

    However, after a restart, the whole layout and format got messed up. So I reinstalled:

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

    This brought me back to the first problem.

    Do you have a solution for exporting a correlation matrix with many variables to Word?

    Thank You

  41. Nick Wansem June 26, 2020 at 5:20 pm - Reply

    Hi professor,

    When using asdoc pwcorr I receive an “rtf_maker(): 3301 subscript invalid : – function returned error” error.

    My command is: asdoc pwcorr Bar_downsizing Bar_brexit Bar_financialissues Bar_financialissuesonlysov Bar_futureoutlook Bar_generalissues Bar_generalissuesonlysov Bar_humanaccidents Bar_humanaccidentsonlysov Bar_internalwrongdoing Bar_labourproblems Bar_naturaldisasters Bar_naturaldisastersonlysov Bar_operationalrisk Bar_pandemics Bar_sanctions Bar_strategicproblems Bar_posfutureoutlookonlysov Bar_posfinancialonlysov Bar_positive Bar_positiveonlysov Bar_strategicrisk, star(all) nonum

    It contains quite some variables. I have installed this: “net install asdoc, from(http://fintechprofessor.com) replace” however it does not help. Do you have suggestions for this problem?

  42. Ariel Zellman July 7, 2020 at 10:42 pm - Reply

    Thank you so much for this amazing project; it has literally saved me hours of manual table building! Only one comment that I cannot figure out how to change the default text which appears at the end of my regression tables. For instance, after using “setstars” , my updated key did not appear in the text. Nor did the text reflect my use of robust standard errors rather than (non-robust) standard errors.

    • Ariel Zellman July 8, 2020 at 11:50 am - Reply

      And as an update, I realized this morning that the setstars option can only accommodate 3 levels of significance and only when using asterisks to indicate significance. Attempts to specify otherwise, for example setstars(***@0.001, **@0.01, *@0.05, +@0.1), result in the table outputting the default code. Using, for example setstars(***@0.001, **@0.01, *@0.05) does however result in an update to the default text at the end of the table to accurately reflect the new significance indicators. You may want to consider updating this function in the next version to accommodate more significance levels and other symbols. Thanks again!

      • Attaullah Shah July 8, 2020 at 11:53 am - Reply

        Ariel Zellman
        Thanks for your message and suggestions. I have noted them and shall consider them in my next update.

Leave A Comment