Questions: I have time and location dummies which I want to include in the regression, but do not want to report them in the regression nested tables created with asdoc. How can I do that?

If you have not already installed asdoc, you can install it from SSC by typing the following in the Stata command window:

ssc install asdoc

Let’s use an example data set.

use http://fintechprofessor.com/regdata.dta, clear

This dataset has four main independent variables, named as x1, x2, x3, x4 and a set of possible dummy variables that will be constructed from the variable year (from 2001-2005) and location (from 1-3). Let us estimated the following regression:

`asdoc reg y x1 x2 x3 i.year i.location, nest drop(i.year i.location) replace `

asdoc reg y x1 x2 x4 i.year i.location, nest drop(i.year i.location)

### Explanations

In the above two lines, we have estimated two regressions and sent their output to a Word file. In the first line, we estimated a regression with the three main independent variables *x1, x2*, and *x3* and included the *year* and *location* dummies on the fly. The option * nest *will create a nested regression table. The option

**drops these dummy variables from the regression table, however, they are included in the main regression. The two lines produce the following regression table in MS Word.**

*drop(i.year i.location)*

Yen XaoAugust 15, 2018 at 11:32 amI was looking for this possibility since long. Thanks for this post.

Allen CohenAugust 30, 2018 at 1:12 amThis program has helped me a lot. Thanks for this contribution.

HPNovember 19, 2018 at 4:49 amIs there any option to include Year_Dum Yes or no Location_dum yes or no in the results? If we want to include the order of the variables in the table such as _cons x1 x2 x3 etc, do we have options?

Attaullah ShahNovember 19, 2018 at 7:25 amHP: yes, we can add it. I have shown that in my YouTube video in much details. However, if you want a quick answer, see the following code:

YılmazNovember 14, 2019 at 4:50 amHi Proffesor, I want to drop(i.year i.location) but dont want to nest. When I try it, nothing change. can u help me

without nest your code:

asdoc reg y x1 x2 x3 i.year i.location, drop(i.year i.location) replace add(Year dummies, yes, location dummies, yes)

Attaullah ShahMay 11, 2022 at 12:44 pmOption drop works only with the nested regression.

HpDecember 2, 2020 at 9:58 pmDr. Shah,

Thank you for the great work. Is there a way to order the variables in the regression table. Given

Observations 50 50

R-squared .666 .669

Year dummies yes yes

location dummies yes yes

Want to present as

Year dummies yes yes

location dummies yes yes

Observations 50 50

R-squared 66.60% 66.90%

Thank you.

Attaullah ShahMay 11, 2022 at 12:45 pmYes, see this post https://fintechprofessor.com/2019/01/31/ordering-variables-in-a-nested-regression-table-of-asdoc-in-stata/

Roy te RieleMay 18, 2021 at 12:19 amHi Professor, Currently I want to create a regression based on your given commands. This has led to the following do-file for me:

destring sic2, replace force

xtset sic2

asdoc reg EQ BIND FINEXP TENURE TENURESQ i.DumEXP#c.TENURE size ROA pastloss MTB lev y2010 y2011 y2012 y2013 y2014 y2015 y2016 y2017 y2018 y2019 i.year i.sic2, nest drop(i.year i.location) replace add (Year Fixed Effect, Yes, Industry Fixed Effect, Yes).

However, after running this do-file in stata i get the following error code: invalid ‘yes’ r(198);

Do you guys have any idea to solve this problem for me?

Thanks in advance and I would like to hear from you

Kind regards, Roy

Attaullah ShahMay 30, 2021 at 12:42 pmThere should be no space between

`add`

and the parenthesis. It should be typed like this`add(Year Fixed Effect, Yes, Industry Fixed Effect, Yes)`