Publication quality regression tables with asdoc in Stata – video example

Home/Stata Programs/asdoc/Publication quality regression tables with asdoc in Stata – video example

Creating publication-quality tables in Stata with asdoc is as simple as adding asdoc to Stata commands as a prefix. asdoc can create two types of regression tables. The first type (call it detailed) is the detailed table that combines key statistics from the Stata’s regression output with some additional statistics such as mean and standard deviation of the dependent variable etc. This table is the default option in asdoc. The second table is a compact table that nests more than one regressions in one table (call it nested).

In this video post, I show how to use asdoc to produce the following nested table.

Firstly, thank you for making your Stata package available – it’s really speeding up my workflow compared to the other options available. I’m writing to make a suggestion that you consider adding an option that value labels can be reported in regression tables as well as variable labels.

asdoc is an amazing service to the field. Appreciate it very much. Like Nicole, I would love a labels option for regression outputs. That function works great for asdoc sum, but would be of great value in this function too.

Dear Eric and Nicole, thanks for your suggestions. I am exploring the suggested possibilities. Since version 2 of asdoc is almost ready, I may come up with label option in version 3 or version 2.1.

Appreciate for your great work ,thank you for making your Stata package available – it’s really speeding up my workflow and saved time. Honestly , i learned a lot .
i asked one question Can asdoc command used for advance Dynamic Model ? e.g asdoc reg .. How to used for Dynamic Model to create tables ? Your response with this regard is highly appreciated

Attaullah Shah
September 10, 2018 at 2:24 pm - Reply

Sher Khan, can you tell which specific Stata command are you referring to?

I am excited to see this! However, I have a question. What would the code be if we want to put several models into the same table with different IVs but the same DV? So, say in the first model I want to include IV1, in the second model IV2, and so forth. But in model 6 I want to include IVs1-IVs5. What would this code look like if I’m nesting my model?

Attaullah Shah
September 18, 2018 at 2:52 pm - Reply

Dear Mike
Let us say that our dependent variable is DV and our independent variables are named IV1, IV2, IV3, IV4, IV5, and IV6. You have asked that what if we run a separate regression on each independent variable and then include all independent variables in one model at the end. Then our codes would be

asdoc reg DV IV1, replace nest cnames(IV1)
asdoc reg DV IV2, nest cnames(IV2)
asdoc reg DV IV3, nest cnames(IV3)
asdoc reg DV IV4, nest cnames(IV4)
asdoc reg DV IV5, nest cnames(IV5)
asdoc reg DV IV6, nest cnames(IV6)
asdoc reg DV IV1-IV6, nest cnames(all)

That would so fantastic. Being able to use the reporting options, nested ORs and 95% CIs especially, to get tables directly to Word would save me hours of table-copying.

Attaullah Shah
October 12, 2018 at 4:53 pm - Reply

Justin: You mean to report the 95% CIs instead of t-values or standard errors?

Thank You so much sir for sharing your knowledge with.us.sir I have one question, how can I replace t-value on se value in regression tables, I tried but it shows se value in. perenthesis in word tables.plz, guide me. best regards

Attaullah Shah
October 27, 2018 at 10:43 am - Reply

Ayub : I think you are referring to nested regression tables. If yes, then you can use the option rep(t), which will report t-values instead of standard errors. For example,

Dr Zumin Shi
November 10, 2018 at 12:08 am - Reply

I like your asdoc very much. In epidemiological research, we often focus on one independent variable (recoded into quartiles) and run multiple multivariable models (with different adjustment). The regression coefficients are often reported in one table (see below). Is it possible to do it using asdoc?

Q1

Q2

Q3

Q4

p for trend

Model 1

1.00

0.86 (0.52-1.42)

0.66 (0.40-1.11)

0.57 (0.33-0.98)

0.024

Model 2

1.00

0.85 (0.51-1.41)

0.64 (0.38-1.08)

0.58 (0.34-1.00)

0.028

Model 3

1.00

0.93 (0.54-1.61)

0.76 (0.42-1.37)

0.78 (0.43-1.43)

0.332

note: model 1 adjusted for age
model 2 further adjusted for education, and physical activity
model 3 further adjusted for hypertension.

p for trend was calculated using qartiles of fruit intake as an ordinal variable in logistic regression.
The table is based on six logistic regression models.

Bassem Hamandi
November 22, 2018 at 10:24 pm - Reply

Thank you for developing this Stata package. I wonder if there is a way to export the 95% confidence interval reported after running stcox in Stata? My apologies if this is trivial but I could not find any details in the help file.
Thank you for any help you can provide.

Attaullah Shah
November 22, 2018 at 11:29 pm - Reply

Bassem Hamandi : Thanks for your query. Adding CI to regression tables with asdoc is on my agenda for the next update. Can you please indicate whether you want the CIs with detailed regression tables or nested tables using asdoc. You can see the help file, Section 4.1 and 4.2

Bassem Hamandi
November 22, 2018 at 11:32 pm - Reply

Thank you. I am hoping to report using detailed regression tables.

I am not able to make my loop save the results after regressing over files (betas, t, R2 and N), with all my datasets. I have 11 named 2005.dta to 2017.dta (except for 2009) contained in a folder (F:\datasets).

The objective is to use asdoc, and to generate a summary table of the estimates I make. The code that I have written is the following.

cd "F: \ datasets"
local i: dir. files "* .dta"
foreach file in `i '{
asdoc reg and x1 x2 x3, append nest rep (t | se) title (Table 1 MCO per year) dec (3)
}

But the result is that asdoc saves the results of a single database (only the first – 2005) 11 times and does nothing for the others.

If you could have time to help me solve this problem I would thank you very much.

Cheers Juan

Attaullah Shah
November 30, 2018 at 8:16 pm - Reply

Juan Miranda: The question you have asked on stackoverflow is on hold, so I cannot add my answer there. The loop you are using does not use asdoc on each data set that you have. So the correct code would be:

cd "F:\datasets"
local i : dir "F:\datasets" files "*.dta"
foreach file in `i' {
use `file', clear
asdoc reg y x1 x2 x3, append nest rep(t) title(Table 1 MCO per year) dec(3) save(reg)
}

Please also note that there should be no space between rep and(t | se). The same applies to other options of asdoc.
Also note: the option rep(t) is used to report t-statistics. Instead, if you want to report standard errors, you would use rep(se). However, you cannot use both rep(t|se). Perhaps, you copied this from the help file of asdoc, where the symbol pipe is used to denote that one of these can be used.

Dr. Naimat Ullah Khan
December 18, 2018 at 2:11 pm - Reply

Salam Jee,

If I wish to generate a table with standard errors instead of p-values, what I have to do with asdoc command?

Attaullah Shah
December 18, 2018 at 2:13 pm - Reply

Dear Dr. Naimat: Which regression table do you want to generate? The nested one or the detailed one? I think you are referring to the nested tables.

In the nested table, you can report either standard errors or t-values. For standard errors, you can use the option rep(se)

Hello Dr. Shah,
Wonderful work on asdoc. It has made life easy for many students like me. I am using Fairle decomposition in stata with ado. file for it. I found the asdoc command doesnot work with it. If you get time please check it and update it in the next version. Thank you.

Preshit Ambade: Thanks for your comment and feedback. Can you please share an example data and the code that does not work with asdoc. I shall work on it.

. I want to use order option like estout.
2. Is there decimal alignment options?
Thank you for your help .
HP

Attaullah Shah
January 12, 2019 at 8:13 am - Reply

HP:
Thanks for your suggestions. I have noted them and will consider them in the next update of asdoc.

Attaullah Shah
January 31, 2019 at 11:55 am - Reply

HP
Turns out that we can use the keep option for ordering variables as well as keeping required variables. Let me present two examples in this blog post as this feature needs more attention.

Thanks. One more question.
How to report Pseudo R2 in asdoc regression results.
Thanks.
HP

Krishanu Karmakar, PhD
January 24, 2019 at 9:30 pm - Reply

Recently I came across your -asdoc- routine in Stata and was trying to use it for my Econometrics courses. I think I came across a bug in the routine. If you have time kindly have a look at it. The stata code is copied below.

Description of the problem: When creating tables with multiple equations, where one of the equations may have a logged dependent variable, it is quite difficult to use the eform option with asdoc – mostly the output is wrong. Probably you did intend to make “eform” an option for asdoc. It still takes the option but makes only the first equation of the set exponentiated. No matter which command I add the “eform” option to, it is always only the first equation that is exponentiated. code below.

System: Windows 10, asdoc version 2.2.0

***************************************
version 14.2
sysuse auto, clear
gen lnmpg=ln(mpg)
*base models, no exponentiation tried
asdoc reg mpg turn, eform() save(file.doc) reset nest replace
asdoc reg lnmpg turn, save(file.doc) nest
asdoc reg lnmpg turn, save(file.doc) nest ///
title(table1: base models, no exponentiation tried)
*eform() in first command - nothing happens
asdoc reg mpg turn, eform() save(file.doc) reset nest
asdoc reg lnmpg turn, save(file.doc) nest
asdoc reg lnmpg turn, save(file.doc) nest ///
title(table2: eform in first command - nothing happens)
*eform() all last command - first equation exponentiated
asdoc reg mpg turn, eform() save(file.doc) reset nest
asdoc reg lnmpg turn, eform() save(file.doc) nest
asdoc reg lnmpg turn, eform() save(file.doc) nest ///
title(table3: eform in all commands - only first equation exponentiated)
***********************************************************

Anyway, notwithstanding this small bug, thank you for writing a quite useful routine.

Dear Dr. Krishanu Karmakar
Thanks for pointing this out. I have fixed these issues in version 2.3.3, dated Feb 23, 2019. You can install the new version from SSC

ssc install asdoc, replace

Joanna Woersching
March 3, 2019 at 7:47 am - Reply

Hi Dr. Shah,
Thank you very much for this wonderful program, will save me hours of table editing. I was hoping to create a nested table with odds ratio, se and confidence interval listed, are these options for asdoc nest? Thank you, Joanna Woersching

Joanna Woersching
I replied to your query on the Statalist here
If that is not what you are looking for, please provide some details on your desired output.

Krishanu Karmakar
March 3, 2019 at 6:08 pm - Reply

Thank you for taking a look at it and spending your valuable time on this. This command is a wonderful addition to user written commands of Stata.

When I use logit with or option, it provides the coefficient instead of the odds ratio. I check the numbers, and those were coefficient, and not OR. IS there a way to display the odds ratio?

Richard Makurumidze
April 7, 2019 at 3:53 am - Reply

Greetings

It seems asdoc does not work with the chi (chi -square) and or (odds ratio) in logistic regression. Is this correct or am making some error?

– Is there any way to export ONLY the coefficients in the nested regression output table? Without including standard errors OR t-values?
– Or if not, is there a way to export the table so that the standard errors / t-values are in the same table cell as the coefficients? And not in the cell below them?

Micah:
On your suggestion, I have added option notse to the nested regression. With this option, the output will omit standard errors or t-values. The updated version can be installed by typing the following in Stata command window:

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

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.

Is the asdoc for un-weighted estimates?
asdoc svy: table sex urb, col row sc format(%11.0f) //gives unweighted estimates
asdoc table sex urb, col row sc format(%11.0f) //gives unweighted estimates
table sex urb[pw=wgt_test], col row sc format(%11.0f) //gives weighted estimates
kindly clarify it.

Hi,
Is it possible to get the same table as with nest function, with the wide format? Missing t values or standard deviation , with p values in the wide version.

Dear professor,
margins are not working in my analysis. Is this command is not compatible with asdoc? or I am doing it wrong? Kindly advise
……………………………

When you use the nested function, you get SD values in parentheses under the coefficients. You also get *** for p values. And you have the dependent variable in the columns.
With the wide function, where you have the dependent variables in the rows, you do not get the SD in parentheses under the coefficients. So, i would like in the wide option to have the same model output as with the nested function, only with the dependent variables in the rows, such as with the wide option. I would like the t values to be switched out with SD in the wide option also.

Theo
Seem you might benefit from reading the help file of asdoc. It has dozens of example on how to use the different options with the wide regression tables. What you are asking is already there. See the following example where I am reporting the SE under the regression coefficients and stars with coefficients for statistical significance.

You can read asdoc help file by

help asdoc

. Specifically, read Section 4.3 of the help file and examples 26 to 35.

Following are the examples of wide regressions with the mentioned options

I am very thankful for your asdoc – breakthrough – program.
My name is Jana Tillmann and I currently write my Thesis. Hopefully, you can help me with this issue, it is very urgent as I have to hand in the thesis on Thursday.
What can I do to create a nested table with multiple additional regression statistics?

When I try to create nested regression tables, I can not find a solution to extend the tables with multiple additional regression statistics.

The error you are getting is due to incorrect use of the stat() option.

Since asdoc report observations by default, there is no need to write N in the stat option.
The stat() option needs that you type comma between different statistics.
So the correct syntax would be

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.

I am very thankful for your asdoc – breakthrough – program.
My name is Jana Tillmann and I currently write my Thesis.

Hopefully you can help me with this issue, it is very urgent as I have to hand in the thesis on Thursday.
What can I do to create a nested table with multiple additional regression statistics?

When I try to create nested regression tables, I can not find a solution to extend the tables with multiple additional regression statistics.

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.

Dr. Emily C. Phillips Galloway
September 18, 2019 at 10:43 am - Reply

Dear Dr. Shah,

Thank you for this wonderful program!

I’m attempting to create a regression table that contains multiple regression models, but am encountering this error:

func_nested_reg(): 3001 expected 25 arguments but received 28
: - function returned error

Could you tell me what I ma doing incorrectly? I’ve updated asdoc.

Attaullah Shah
September 18, 2019 at 10:50 am - Reply

Dr. Emily
Due to the complex structure of the mixed command, asdoc finds it difficult to parse the command. As an alternative, asdoc offers the replay command for such cases. See this example

webuse productivity
mixed gsp private emp hwy water other unemp || region: || state:, mle
asdoc replay, replace nest
mixed gsp private emp hwy water other || region: || state:, mle
asdoc replay, nest

Travis Petersen
October 29, 2019 at 7:51 pm - Reply

Hi Dr. Shah,

Thank you for your excellent work on the asdoc program. It is very useful. I was wondering if it is possible to use value labels to regression of categorical values in asdoc? Sorry to bother you, but I have looked all over and can’t seem to find an answer. For example:

Is there a way to have asdoc code for Domestic/Foreign rather than 0b.foreign/1.foreign, or do I just have to replace all of the value labels manually? Thank you very much for your time.

Attaullah Shah
October 29, 2019 at 7:56 pm - Reply

Travis Petersen
This was implemented in the new version, available on my site. For example,

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.

Caroline Laborde
October 29, 2019 at 9:43 pm - Reply

Hi Dr. Shah,

Thank you for your excellent work on the asdoc program. It’s amazing and very useful! I wonder if it is possible to use asdoc with xi command for logistic resgressions (and it will be great for nested regressions too)?
In fact when I use asdoc in this command

asdoc xi: svy, subpop if (accond==1 | accond==2) : logistic limit_senso_sev i.sexe age i.diplome_R, or replace

I have this message error: “sexe: string variables may not be used as factor variables”
Thanks a lot for your help and answer!!

Attaullah Shah
October 31, 2019 at 2:05 am - Reply

For such complex syntax, you can use the replay option.

func_nested_reg(): 3001 expected 28 arguments but received 29

what does it mean and how to solve it

Attaullah Shah
November 17, 2019 at 12:04 pm - Reply

Julian Lucas
It seems that you have updated asdoc, however, the update was not successful. Some of the old files still exist after the update, therefore, you can re-install asdoc by typing the following lines in Stata command window.

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 maintaining asdoc. I’m wondering if asdoc could modify the variable name in regression results? I check in help.doc but I didn’t find any options. For example, we may want to change the interaction term’s displayed name.

Attaullah Shah
January 30, 2020 at 6:39 pm - Reply

Brian
Thanks for asking. This option is currently not available in asdoc. I welcome patrons to finance specific additions to asdoc. If you are interested, please let me know and I shall work on this.

Dear Prof. Shah,
Thank you for a wonderful program! Can you tell me how to not put stars in the nested regression outputs? Even after adding “nostars” in the command, I see the stars in the output. Am I doing something wrong?
Regards

Louis Boakye-Yiadom
March 22, 2020 at 9:54 pm - Reply

Hello Prof. Shah,
Is there a way of ensuring that the stars included in a regression output are attached to the regression coefficients and are not shown by themselves in a separate column? Thank you.

Thank you for this asdoc feature. Its such a great one.
I wish to find ot how to export my multinomial regression results reporting odds ratios to word.
The rests I have in word and the stata output are quite different so I dont know if I am doing something wrong.

Nicole MartinJune 8, 2018 at 10:33 pmFirstly, thank you for making your Stata package available – it’s really speeding up my workflow compared to the other options available. I’m writing to make a suggestion that you consider adding an option that value labels can be reported in regression tables as well as variable labels.

Many thanks, and best wishes,

EmilyAugust 1, 2018 at 1:36 amCan ” asdoc” export the OR and 95% CI from logistic regression analysis?

Attaullah ShahAugust 1, 2018 at 2:03 amDear Emily

Version 2.0 of asdoc will have this option.

EricAugust 16, 2018 at 7:00 pmasdoc is an amazing service to the field. Appreciate it very much. Like Nicole, I would love a labels option for regression outputs. That function works great for asdoc sum, but would be of great value in this function too.

Thanks again.

Attaullah ShahAugust 16, 2018 at 9:37 pmDear Eric and Nicole, thanks for your suggestions. I am exploring the suggested possibilities. Since version 2 of asdoc is almost ready, I may come up with label option in version 3 or version 2.1.

Sher KhanSeptember 10, 2018 at 11:39 amAppreciate for your great work ,thank you for making your Stata package available – it’s really speeding up my workflow and saved time. Honestly , i learned a lot .

i asked one question Can asdoc command used for advance Dynamic Model ? e.g asdoc reg .. How to used for Dynamic Model to create tables ? Your response with this regard is highly appreciated

Attaullah ShahSeptember 10, 2018 at 2:24 pmSher Khan, can you tell which specific Stata command are you referring to?

MikeSeptember 18, 2018 at 5:26 amI am excited to see this! However, I have a question. What would the code be if we want to put several models into the same table with different IVs but the same DV? So, say in the first model I want to include IV1, in the second model IV2, and so forth. But in model 6 I want to include IVs1-IVs5. What would this code look like if I’m nesting my model?

Attaullah ShahSeptember 18, 2018 at 2:52 pmDear Mike

Let us say that our dependent variable is DV and our independent variables are named IV1, IV2, IV3, IV4, IV5, and IV6. You have asked that what if we run a separate regression on each independent variable and then include all independent variables in one model at the end. Then our codes would be

JustinOctober 11, 2018 at 1:56 pmThis is a wonderful tool! Thank you so much for making this available.

I see asdoc v2.0 allows ORs from ologit in the detailed table output. Is it possible to display ORs in the nested table output as well?

Attaullah ShahOctober 11, 2018 at 4:41 pmJustin: I missed the option eform when coding the nest option. Hopefully, I shall add it in the next update

JustinOctober 12, 2018 at 4:15 pmThat would so fantastic. Being able to use the reporting options, nested ORs and 95% CIs especially, to get tables directly to Word would save me hours of table-copying.

Attaullah ShahOctober 12, 2018 at 4:53 pmJustin: You mean to report the 95% CIs instead of t-values or standard errors?

JustinOctober 16, 2018 at 5:35 pmYes!

Attaullah ShahOctober 16, 2018 at 7:48 pmJustin: I have noted your suggestions and will consider them in future updates of the asdoc. Thanks.

AyubOctober 27, 2018 at 7:39 amThank You so much sir for sharing your knowledge with.us.sir I have one question, how can I replace t-value on se value in regression tables, I tried but it shows se value in. perenthesis in word tables.plz, guide me. best regards

Attaullah ShahOctober 27, 2018 at 10:43 amAyub : I think you are referring to nested regression tables. If yes, then you can use the option rep(t), which will report t-values instead of standard errors. For example,

Dr Zumin ShiNovember 10, 2018 at 12:08 amI like your asdoc very much. In epidemiological research, we often focus on one independent variable (recoded into quartiles) and run multiple multivariable models (with different adjustment). The regression coefficients are often reported in one table (see below). Is it possible to do it using asdoc?

Q1

Q2

Q3

Q4

p for trend

Model 1

1.00

0.86 (0.52-1.42)

0.66 (0.40-1.11)

0.57 (0.33-0.98)

0.024

Model 2

1.00

0.85 (0.51-1.41)

0.64 (0.38-1.08)

0.58 (0.34-1.00)

0.028

Model 3

1.00

0.93 (0.54-1.61)

0.76 (0.42-1.37)

0.78 (0.43-1.43)

0.332

note: model 1 adjusted for age

model 2 further adjusted for education, and physical activity

model 3 further adjusted for hypertension.

p for trend was calculated using qartiles of fruit intake as an ordinal variable in logistic regression.

The table is based on six logistic regression models.

Bassem HamandiNovember 22, 2018 at 10:24 pmThank you for developing this Stata package. I wonder if there is a way to export the 95% confidence interval reported after running stcox in Stata? My apologies if this is trivial but I could not find any details in the help file.

Thank you for any help you can provide.

Attaullah ShahNovember 22, 2018 at 11:29 pmBassem Hamandi : Thanks for your query. Adding CI to regression tables with asdoc is on my agenda for the next update. Can you please indicate whether you want the CIs with detailed regression tables or nested tables using asdoc. You can see the help file, Section 4.1 and 4.2

Bassem HamandiNovember 22, 2018 at 11:32 pmThank you. I am hoping to report using detailed regression tables.

Juan MirandaNovember 30, 2018 at 8:16 pmDear Attaullah Shah, good afternoon.

I’m a Stata user, but some programming things I do not understand yet.

I’ve been looking at forums like https://stackoverflow.com/questions/53524560/looping-and-storing-beta-coefficients-after-regress-over-files#new-answer

answer to a question I have.

I am not able to make my loop save the results after regressing over files (betas, t, R2 and N), with all my datasets. I have 11 named 2005.dta to 2017.dta (except for 2009) contained in a folder (F:\datasets).

The objective is to use asdoc, and to generate a summary table of the estimates I make. The code that I have written is the following.

But the result is that asdoc saves the results of a single database (only the first – 2005) 11 times and does nothing for the others.

If you could have time to help me solve this problem I would thank you very much.

Cheers Juan

Attaullah ShahNovember 30, 2018 at 8:16 pmJuan Miranda: The question you have asked on stackoverflow is on hold, so I cannot add my answer there. The loop you are using does not use asdoc on each data set that you have. So the correct code would be:

Please also note that there should be no space between

`rep`

and`(t | se)`

. The same applies to other options of asdoc.Also note: the option

`rep(t)`

is used to report t-statistics. Instead, if you want to report standard errors, you would use`rep(se)`

. However, you cannot use both`rep(t|se)`

. Perhaps, you copied this from the help file of asdoc, where the symbol pipe is used to denote that one of these can be used.Dr. Naimat Ullah KhanDecember 18, 2018 at 2:11 pmSalam Jee,

If I wish to generate a table with standard errors instead of p-values, what I have to do with asdoc command?

Attaullah ShahDecember 18, 2018 at 2:13 pmDear Dr. Naimat: Which regression table do you want to generate? The

`nested`

one or the`detailed`

one? I think you are referring to the nested tables.In the nested table, you can report either standard errors or t-values. For standard errors, you can use the option

`rep(se)`

and for t-values, you can use the option

`rep(t)`

for example

Dr. Naimat Ullah KhanDecember 19, 2018 at 12:43 amDear Sir Jee

Every time I use asdoc, I pray for you my heart.

Preshit AmbadeJanuary 5, 2019 at 4:16 amHello Dr. Shah,

Wonderful work on asdoc. It has made life easy for many students like me. I am using Fairle decomposition in stata with ado. file for it. I found the asdoc command doesnot work with it. If you get time please check it and update it in the next version. Thank you.

Regards

Preshit

Attaullah ShahJanuary 5, 2019 at 7:04 amPreshit Ambade: Thanks for your comment and feedback. Can you please share an example data and the code that does not work with asdoc. I shall work on it.

HPJanuary 11, 2019 at 11:06 pmHello Dr. Shah,

H have few questions?

1. I am wondering if we can use order option in asdoc regresssion as

. I want to use order option like estout.

2. Is there decimal alignment options?

Thank you for your help .

HP

Attaullah ShahJanuary 12, 2019 at 8:13 amHP:Thanks for your suggestions. I have noted them and will consider them in the next update of asdoc.

Attaullah ShahJanuary 31, 2019 at 11:55 amHP

Turns out that we can use the keep option for ordering variables as well as keeping required variables. Let me present two examples in this blog post as this feature needs more attention.

HPJanuary 12, 2019 at 5:38 pmThanks. One more question.

How to report Pseudo R2 in asdoc regression results.

Thanks.

HP

Krishanu Karmakar, PhDJanuary 24, 2019 at 9:30 pmRecently I came across your -asdoc- routine in Stata and was trying to use it for my Econometrics courses. I think I came across a bug in the routine. If you have time kindly have a look at it. The stata code is copied below.

Description of the problem: When creating tables with multiple equations, where one of the equations may have a logged dependent variable, it is quite difficult to use the eform option with asdoc – mostly the output is wrong. Probably you did intend to make “eform” an option for asdoc. It still takes the option but makes only the first equation of the set exponentiated. No matter which command I add the “eform” option to, it is always only the first equation that is exponentiated. code below.

System: Windows 10, asdoc version 2.2.0

Anyway, notwithstanding this small bug, thank you for writing a quite useful routine.

Attaullah ShahMarch 3, 2019 at 8:12 amDear Dr. Krishanu Karmakar

Thanks for pointing this out. I have fixed these issues in version 2.3.3, dated Feb 23, 2019. You can install the new version from SSC

Joanna WoerschingMarch 3, 2019 at 7:47 amHi Dr. Shah,

Thank you very much for this wonderful program, will save me hours of table editing. I was hoping to create a nested table with odds ratio, se and confidence interval listed, are these options for asdoc nest? Thank you, Joanna Woersching

Attaullah ShahMarch 3, 2019 at 8:18 amJoanna WoerschingI replied to your query on the Statalist here

If that is not what you are looking for, please provide some details on your desired output.

Krishanu KarmakarMarch 3, 2019 at 6:08 pmThank you for taking a look at it and spending your valuable time on this. This command is a wonderful addition to user written commands of Stata.

DanielApril 5, 2019 at 8:35 pmWhen I use logit with or option, it provides the coefficient instead of the odds ratio. I check the numbers, and those were coefficient, and not OR. IS there a way to display the odds ratio?

Richard MakurumidzeApril 7, 2019 at 3:53 amGreetings

It seems asdoc does not work with the chi (chi -square) and or (odds ratio) in logistic regression. Is this correct or am making some error?

Attaullah ShahApril 7, 2019 at 10:04 amSince your pointed needed some detailed replies, I have replied to your querry in this blog post.

MicahApril 8, 2019 at 7:45 pmHi there!

– Is there any way to export ONLY the coefficients in the nested regression output table? Without including standard errors OR t-values?

– Or if not, is there a way to export the table so that the standard errors / t-values are in the same table cell as the coefficients? And not in the cell below them?

Thank you so much for all that you do!!

Attaullah ShahApril 9, 2019 at 12:02 amMicah:On your suggestion, I have added option

`notse`

to the nested regression. With this option, the output will omit standard errors or t-values. The updated version can be installed by typing the following in Stata command window:In-text citationTables 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.

Kabir AhmedApril 20, 2019 at 7:56 amIs the asdoc for un-weighted estimates?

asdoc svy: table sex urb, col row sc format(%11.0f) //gives unweighted estimates

asdoc table sex urb, col row sc format(%11.0f) //gives unweighted estimates

table sex urb[pw=wgt_test], col row sc format(%11.0f) //gives weighted estimates

kindly clarify it.

TheoJune 18, 2019 at 10:07 pmHi,

Is it possible to get the same table as with nest function, with the wide format? Missing t values or standard deviation , with p values in the wide version.

Thanks.

Attaullah ShahJune 18, 2019 at 11:13 pmTheo

I did not get your question. Are you asking for a wide regression table with no t-values or se?

ALI UBAIDJune 19, 2019 at 11:11 amDear professor,

margins are not working in my analysis. Is this command is not compatible with asdoc? or I am doing it wrong? Kindly advise

……………………………

Attaullah ShahJune 19, 2019 at 11:12 amPlease provide an example of what is not working with asdoc. You can refer me to an example data set and the code that you are using with asdoc.

ALI UBAIDJune 19, 2019 at 11:15 amapologies for bothering you, I found the correct command online it was helpful and issued resolved.

Thank you for your response.

TheoJune 19, 2019 at 5:09 pmHi,

Thanks for replying.

When you use the nested function, you get SD values in parentheses under the coefficients. You also get *** for p values. And you have the dependent variable in the columns.

With the wide function, where you have the dependent variables in the rows, you do not get the SD in parentheses under the coefficients. So, i would like in the wide option to have the same model output as with the nested function, only with the dependent variables in the rows, such as with the wide option. I would like the t values to be switched out with SD in the wide option also.

Hope this is a little more clear.

Attaullah ShahJune 19, 2019 at 5:41 pmTheo

Seem you might benefit from reading the help file of asdoc. It has dozens of example on how to use the different options with the wide regression tables. What you are asking is already there. See the following example where I am reporting the SE under the regression coefficients and stars with coefficients for statistical significance.

You can read asdoc help file by

. Specifically, read Section 4.3 of the help file and examples 26 to 35.

Following are the examples of wide regressions with the mentioned options

Jana TillmannJune 25, 2019 at 12:59 amDear Professor Shah,

I am very thankful for your asdoc – breakthrough – program.

My name is Jana Tillmann and I currently write my Thesis. Hopefully, you can help me with this issue, it is very urgent as I have to hand in the thesis on Thursday.

What can I do to create a nested table with multiple additional regression statistics?

When I try to create nested regression tables, I can not find a solution to extend the tables with multiple additional regression statistics.

Here is the command I use:

If I use only one additional statistic:

–

`RMSE`

:If I use stats() instead of stat(), I don’t get any additional statistics:

If I list them separately, it only gives me the latter one:

With a wide format, it does work:

What can I do to create a nested table with a few extra regression statistics?

Attaullah ShahJune 25, 2019 at 1:00 amJana

The error you are getting is due to incorrect use of the stat() option.

Since asdoc report observations by default, there is no need to write N in the stat option.

The stat() option needs that you type comma between different statistics.

So the correct syntax would be

Please cite asdoc in your research.

In-text citationTables 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.

Jana TillmannJune 29, 2019 at 1:24 pmDear Professor Shah,

I am very thankful for your asdoc – breakthrough – program.

My name is Jana Tillmann and I currently write my Thesis.

Hopefully you can help me with this issue, it is very urgent as I have to hand in the thesis on Thursday.

What can I do to create a nested table with multiple additional regression statistics?

When I try to create nested regression tables, I can not find a solution to extend the tables with multiple additional regression statistics.

Here is the command I use:

If I use only one additional statistic:

– RMSE:

If I use

`stats()`

instead of`stat()`

, I don’t get any additional statistics:If I list them separately, it only gives me the latter one:

With a wide format, it does work:

What can I do to create a nested table with a few extra regression statistics?

Attaullah ShahJune 29, 2019 at 1:27 pmI 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).

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.

Dr. Emily C. Phillips GallowaySeptember 18, 2019 at 10:43 amDear Dr. Shah,

Thank you for this wonderful program!

I’m attempting to create a regression table that contains multiple regression models, but am encountering this error:

Could you tell me what I ma doing incorrectly? I’ve updated asdoc.

Thank you!

Emily

Attaullah ShahSeptember 18, 2019 at 10:50 amDr. EmilyDue to the complex structure of the mixed command, asdoc finds it difficult to parse the command. As an alternative, asdoc offers the replay command for such cases. See this example

Travis PetersenOctober 29, 2019 at 7:51 pmHi Dr. Shah,

Thank you for your excellent work on the asdoc program. It is very useful. I was wondering if it is possible to use value labels to regression of categorical values in asdoc? Sorry to bother you, but I have looked all over and can’t seem to find an answer. For example:

Is there a way to have asdoc code for Domestic/Foreign rather than 0b.foreign/1.foreign, or do I just have to replace all of the value labels manually? Thank you very much for your time.

Attaullah ShahOctober 29, 2019 at 7:56 pmTravis Petersen

This was implemented in the new version, available on my site. For example,

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.

Caroline LabordeOctober 29, 2019 at 9:43 pmHi Dr. Shah,

Thank you for your excellent work on the asdoc program. It’s amazing and very useful! I wonder if it is possible to use asdoc with xi command for logistic resgressions (and it will be great for nested regressions too)?

In fact when I use asdoc in this command

I have this message error: “sexe: string variables may not be used as factor variables”

Thanks a lot for your help and answer!!

Attaullah ShahOctober 31, 2019 at 2:05 amFor such complex syntax, you can use the replay option.

Julian LucasNovember 17, 2019 at 11:06 amGreetings Prof.

I have run this regression

but I am getting this error

what does it mean and how to solve it

Attaullah ShahNovember 17, 2019 at 12:04 pmJulian Lucas

It seems that you have updated asdoc, however, the update was not successful. Some of the old files still exist after the update, therefore, you can re-install asdoc by typing the following lines in Stata command window.

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.

BrianJanuary 30, 2020 at 10:52 amDear Professor,

Thanks for maintaining asdoc. I’m wondering if asdoc could modify the variable name in regression results? I check in help.doc but I didn’t find any options. For example, we may want to change the interaction term’s displayed name.

Attaullah ShahJanuary 30, 2020 at 6:39 pmBrian

Thanks for asking. This option is currently not available in asdoc. I welcome patrons to finance specific additions to asdoc. If you are interested, please let me know and I shall work on this.

SmitaMarch 20, 2020 at 12:00 pmDear Prof. Shah,

Thank you for a wonderful program! Can you tell me how to not put stars in the nested regression outputs? Even after adding “nostars” in the command, I see the stars in the output. Am I doing something wrong?

Regards

Louis Boakye-YiadomMarch 22, 2020 at 9:54 pmHello Prof. Shah,

Is there a way of ensuring that the stars included in a regression output are attached to the regression coefficients and are not shown by themselves in a separate column? Thank you.

Attaullah ShahMarch 24, 2020 at 9:30 amThis is currently not included in the asdoc options. I have noted your point and shall consider it in future updates.

Relindis TapangApril 30, 2020 at 8:02 amThank you for this asdoc feature. Its such a great one.

I wish to find ot how to export my multinomial regression results reporting odds ratios to word.

The rests I have in word and the stata output are quite different so I dont know if I am doing something wrong.