Exporting tables from table command was the most challenging part in asdoc programming. Nevertheless, asdoc does a pretty good job in exporting table from table command. asdoc accepts almost all options with table command, except cellwidth(#), stubwidth(#), and csepwidth(#).

## 7.1 One-way table

### Example 54 : One-way table; frequencies shown by default

sysuse auto, clear

asdoc table rep78, title(Table of Freq. for Repairs) replace

### Example 55 : One-way table; show count of non-missing observations for mpg}

asdoc table rep78, contents(n mpg) replace

### Example 56 : One-way table; multiple statistics on mpg requested

asdoc table rep78, c(n mpg mean mpg sd mpg median mpg) replace

### Example 57 : Add formatting – 2 decimals

asdoc table rep78, c(n mpg mean mpg sd mpg median mpg) dec(2) replace

## 7.2 Two-way table

### Example 58 : Two-way table; frequencies shown by default

asdoc table rep78 foreign, replace

### Example 59 : Two-way table; show means of mpg for each cell

asdoc table rep78 foreign, c(mean mpg) replace

### Example 60 : Add formatting

asdoc table rep78 foreign, c(mean mpg) dec(2) center replace

### Example 61 : Add row and column totals

asdoc table rep78 foreign, c(mean mpg) dec(2) center row col replace

## 7.3 Three-way table

### Example 62 : Three-way table

webuse byssin, clear

asdoc table workplace smokes race [fw=pop], c(mean prob) replace

## 7.4 Four-way table

### Example 65 : Four-way table with by()

webuse byssin1, clear asdoc table workplace smokes race [fw=pop], by(sex) c(mean prob) replace

### Example 66 : Four-way table with supercolumn, row, and column totals

asdoc table workplace smokes race [fw=pop], by(sex) c(mean prob) sc col row replace

Michael BurtonOctober 12, 2019 at 12:09 pmI am using asdoc and finding some issues with some commands.

so it should be the most recent version.

generates an error for me:

And then also this fails:

while this works:

option row not allowed

i.e. it requires a space before the option row…

Attaullah ShahOctober 12, 2019 at 12:18 pmHello Michael Burton

I haved fixed both the issues.

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.

Andres Talavera Lima PeruApril 16, 2020 at 5:27 pmERROR asdoc table X Y , c(sum Z) replace ??

clear all

set more off

use table_BD,clear

asdoc table Wsup02a sexo if ((RESULTAD==1 | RESULTAD==2) & P019_01==. & P016==1) , c(sum P020_01) replace

Attaullah ShahApril 16, 2020 at 6:02 pmAndresThanks for sending the data and reporting this issue. This was the rounding problem, which would round larger digits to zeros. 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 do remember to cite asdoc. To cite:

In-text citation

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

BibliographyShah, 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.Andres Talavera Lima PeruApril 17, 2020 at 12:25 pmthanks you so much. This program works very good.

BHA abdFebruary 2, 2021 at 12:35 amDear i have error get message Click to Open File: Myfile.doc need recovery it (asdoc pvargranger )

Opeyemi AromolaranFebruary 24, 2021 at 4:26 pmProf. good day. Thanks for the development of asdoc. I was able to export correlation matrix and descriptive statistics. However I could not use it to export pool mean group equation. I need your suggestion sir.

MonaDecember 16, 2021 at 7:44 pmHello,

When I use asdoc for the table, I have an error “options not allowed”. But I dont have this error for tab2. why?

Attaullah ShahDecember 18, 2021 at 12:53 amPlease try the new version 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.

asdocx is now availableA more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

https://fintechprofessor.com/asdocx

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.

Emmie SpapeJune 15, 2023 at 3:00 pmHi! I would like to use the asdoc command with the following command for my (very large) frequency table.

table (var) (condition), stat(fvfreq gender) statistic(fvpercent gender) stat(fvfreq age) statistic(fvpercent age) stat(fvfreq education) statistic(fvpercent education) stat(fvfreq pol_conservatism) statistic(fvpercent pol_conservatism) stat(fvfreq budget) statistic(fvpercent budget) style(table-1) nformat(%6.2f mean sd) sformat(“(%s)” sd) sformat(“%s%%” fvpercent)

When I simply type asdoc in front, I get the error message variable (var) not found. Without the asdoc command, however, I get the table I want. Would someone like to help me out?