Version 2.0 of asdoc is here. This version brings several improvements, adds new features, and fixes minor bugs in the earlier version. Following is the summary of new features and updates.
Brief Introduction of asdoc
asdoc sends Stata output to Word / RTF format. asdoc creates high-quality, publication-ready tables from various Stata commands such as summarize, correlate, pwcorr, tab1, tab2, tabulate1, tabulate2, tabstat, ttest, regress, table, amean, proportions, means, and many more. Using asdoc is pretty easy. We need to just add asdoc as a prefix to Stata commands. asdoc has several built-in routines for dedicated calculations and making nicely formatted tables.
How to update
The program can be updated by using the following command from Stata command window
ssc install asdoc, replace
New Features in Version 2.0
1. Wide regression tables
This is a new format in which regression tables can be reported. In this format, the variables are shown in columns and one regression is reported per row. Therefore, this type of regressions tables is ideal for portfolios, industries, years, etc. Here is one example of a wide regression table. asdoc allows a significant amount of customization for wide tables including asterisks for showing significance, reporting t-statistics and standard errors either below regression coefficients or sideways, controlling decimal points, reporting additional regression statistics such adjusted R2, RMSE, RSS, etc., adding multiple tables in the same file, and several other features. Read this post to know more about wide table format.
2. Allowing by-group regressions
Version 2.0 of asdoc provides the convenience of estimating regressions over groups and summarizing the regression estimates in nicely formatted tables. This feature follows the Stata default of bysort prefix. This feature works with all three types of regression tables of asdoc that include detailed regression tables, nested tables, and wide tables. In this blog post, I show some examples of by-group regressions.
3. Allowing by-group descriptive statistics
Using the bysort prefix with asdoc, we can now find default, detailed, and customized summary statistics over groups. Details related to this feature will be added later on in a blog post.
4. Option label with tabulate and regress commands
Option label can now be used with regression and tabulation commands. Using this option, asdoc will report variable labels instead of variable names. In case variable labels are empty, then the variable names are reported.
5. Developing tables row by row using option row
Option row is a new feature in version 2. Option row allows building a table row by row from text and statistics. In each run of asdoc with option row, a row is added to the output table. This is a useful feature when statistics are collected from different Stata commands to build customized tables. To know more about this option, read this blog post.
6. Accumulate text or numbers with option accum
Option accum allows accumulating text or numbers in a global macro. Once accumulated, the contents of the macro can then be written to an output file using option row.
7. Saving files in different folders
One additional feature of version 2.0 is the ability to write new files or append to existing files in different folders.
Hi, “asdoc” is very useful!
Would you give an example of its application in logistic regression or , Poisson regression analysis?
Thanks
Sophia: There are three types of regression tables that asdoc can create. Can you please specify which regression table do you intend to make. The regression table types are 1. detailed table 2. nested tables and 3. wide tables. If you open the asdoc help file by typing
in the Stata command window, there you can see further details on these regression types. See table of contents, entries 4.1, 4.2, and 4.3
Hi, asdoc is wonderful.
I am running into an issue with the bysort command where the word or rtf files will not open, and Microsoft Word returns the error “Word was unable to read this document. It may be corrupt.”
example includes:
I do not have this issue when creating bysort regression output.
Any help would be greatly appreciated.
Thanks!
Walker: Please update to version 2.2 and the problem should be solved
Thanks for the reply. I am running v 2.2. I have uninstalled, replaced and restarted the program. I continue to get the following message when I try to open the file generated by any either version of the summary statistics over grouping variable options:
Walker: Can you please do the following?:
1. use the bysort prefix with sum command and option replace e.g.
2. Send the file Myfile.doc to my email address at attaullah.shah@imsciences.edu.pk
I shall investigate the source of the error. Thanks for your time and feedback.
Hi,
I would like to use the bysort option, but I was wondering if you can use more than 1 varname after bysort?
Joske
You can use
bysort
with more than one variables by creating a grouping variable. So using the auto dataset, we can group together the variable foreign and rep78.Thanks for your reply. It’s working.
Is it possible to use asdoc with multinomial logistic regression in Stata
Jukka34
Is there any option analogous to the unstack option in estout for multinomial logistic regressions? I want my results to be displayed side by side for each category of the dependent variable.
Trisha
Currently, unstack option is not available in asdoc. That is on my agenda since long. Thanks for reminding.
Hello, first of all, thank you for the asdoc, it has enabled me to create regression outputs so conveniently. The only problem that I am facing now is that the variable labels do not appear. I have categorical variables and when I do the regression using for example i.education, I do not get the different categories in the output, even though I use the label function and I also updated the version. Could you please let me know what I am doing wrong?
Best Regards,
Lola
Lola
Thanks for your feedback. Can you please send a sample of your data at attaullah.shah@imsciences.edu.pk
Dear Mr. Shah,
I am writing to you regarding a problem that I am facing with asdoc, and as you suggested me at your website, I am sending you the data that I am working with. What I want from the output table is that in cases of categorical variables, such as the variable education_isced, the name of the variable (”education_isced”) and also the labels (”primary”, ”secondary”) to appear in the output table.
Please let me know how I could fix this problem.
The code that I have used is :
I sincerely thank you for your time and help.
The label option sends the variable labels, not the value labels. You are asking for both the variable name and the list of value labels. That is too much to code. You have to first get the value label categories and then combine the name and these categories. And in some cases, the two would be too long to accommodate in the regression table. Still if you are interested, the following solution will work.
1. Get the value lables for each variable ( https://www.statalist.org/forums/forum/general-stata-discussion/general/706869-show-label-value) see one method discussed here, See Nick Solution in post # 6
2. combine the variable name and the value labels
3. Write the combined value to the variable label using
4. And then use the same asdoc code as you are using now i.e. using option label. Whatever is written in the variable label will appear in the regression table.
Respected Sir,
I am very thankful for your contribution in the shape of asdoc and it is very useful for all the stata users.
I want know that, how someone use “by year or group with asdoc command… e.g.
I used
command but it gave error
When I used the above command with (,replace) so it gave “
Please provide the complete command if someone want to regress by years with asdoc command.
Thank you very much for your overall contribution.
Stay blessed always…
I have fixed the issue. 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 also note that using a custom title with bys prefix, all the regressions will have the same title which shall be confusing. Therefore, it is preferred to skip using a custom table title, asdoc will automatically give an appropriate title to each regression table in accordance with the bysort conditions.
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.
Hello;
Thanks for the very helpful command (asdoc). Two quick questions regarding the output. I am using nested table for an system GMM estimation. I need to report on AR(1), AR(2), Hansen J-stat, Diff in Hansen J-stat and instrument count. I put them all under the option add(…) but the output returns only the first 3 stats on top of the automatically reported stats (Obs and Pseudo Rsq). My questions are:
1- Is there a way to expand the number of stat that I can report under the option add(…) ?
2- for AR(1) and AR(2), there seems to be a problem as long as “(” or “)” are used. The command reports an error and there is no output.
Thanks for your time
Dear Mounir
Currently asdoc reports only three additional statistics. asdocx will accept more, asdocx is almost complete. You can check the details of asdocx here https://fintechprofessor.com/stata-programs/asdocx/
For the second question, can you please post some example code to regenerate the said error?
Dear Mr Shah,
Thank you for this tool. I want to ask two questions related to asdoc:
1. I want to obtain a table with the variables in rows, and in columns mean and median by a grouping variable (that can have values of county 1 or county 2). I tried using “asdoc tabstat age gender, stat(p50 median) by(county)” and also “bysort county: asdoc su age gender, stat(p50 median)”, but what I obtain is a table that shows first statistics for county 1 (with age and gender in rows and mean and median in columns), and then below, in a second panel, the same for county 2. But I need to have both counties statistics next to each other. Is this possible with asdoc?
2. When opening the Word doc produced by asdoc, the tables do not fit in the sheet. I need to use “Layout-Autofit-Autofit contents” in Word to be able to format the table correctly. Is there a way to obtain the Word table already formatted to fit the content so that there is no need to do additional steps in Word to see the results?
Thank you in advance for your time and help.
Hi,
I am trying to use asdoc to get a correlation table with the command:
asdoc pwcorr AAERs lev BETA2 ROA ln_MKTV, sig star(0.1) replace
However, I get an error when I do this command:
Can somebody help me with this?
Carrie
This is rather an unusual error message. can you please send your data at attaullah.shah@imsciences.edu.pk or any other dataset that can help me to reproduce the error.
Thanks for the reporting this. I have fixed the issue.
The new version (2.3.8.4 : Changes made on August 27, 2020) 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.