Publication quality regression tables in Stata

Stata regression table types  Types of regression tables

asdocx can create three types of regression tables.

Detailed tables

The first type is the detailed table [ See examples here ] 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 asdocx.

Nested regression tables

The second table is the nested table [ see examples here ] that nests more than one regressions in one table.

Wide regression tables

The third table is the wide table [see asdocx wide tables here ] that reports regression components in a wide or row format. Since wide table offers more than 10 options, it is discussed in this separate section with relevant examples. The following options are available when exporting regression tables with asdocx.

  asdocx options for regression tables

4.1 nested
This option invokes the creation of nested regression tables. Without this option, the default (detailed regression) table is created
by asdocx.

4.2 rep(t | se | p |ci)
This option is used in combination with option nest for reporting t-values rep(t), standard errors rep(se), or p-values rep(p) (with each of the regression coefficient. The default for this option is standard errors. Please note that option rep(t) or option rep(p) will work only when used at the start of the nested table. This is the case either:
(i) when option replace is used or
(ii) the nested table is started for the first time.

4.3 append
append and replace are alternatives and are optional options. If left blank, option append is assumed, which will write the results to
the existing file.

4.4 reset
Option reset causes asdocx to make a new nested table, i.e. instead of appending to the existing nested table, option reset will start a new table in the existing file.

4.5 title(table title)
Option title() is used to write table title. For example, title(Table 1 - Fixed effects model)

4.6 cnames(Column title)
Option cnames() is used to write column title while making a nested table. By default, each column title is named as the name of the dependent variable in nested tables. We can change this name to our desired name with option cnames, e.g., cnames(OLS) or cnames(FE), etc.

4.7 dec(#)
Option dec() is used to specify the number of decimal points. For example, dec(3)

4.8 add(text1, text2 | text3, text4…)
This option adds text legends to the bottom cells of the nested regression table. This option is usually used to show the presence or absence of some variables in the respective regression models. For example, we might include firm, year or industry dummies in a regression model and just indicate with ‘yes’ or ‘no’ the presence of these dummies. This version of asdocx supports up to a maximum of three categories of legends. The text legends should be added in pairs of two, each one separated by a comma. For example:

add(Year dummies, yes)
add(Year dummies, yes, industry dummies, yes)
add(Year dummies, yes, industry dummies, yes, country dummies, no)

4.9 keep(varlist) (used only with option nest)
keep(varlist) and drop(varlist) are alternatives; they specify coefficients to be included or omitted from the table. The default is
to display all coefficients.

4.10 stat()

to include statistics from e() (used only with option nest)
Option stat() can be used to report additional regression statistics that are stored in macro e(); e.g, stat(rmse rss). The e() macros are available after running a regression model. Since asdocx runs regression models below the surface, these macros are obtained by asdocx and can be reported by providing the macro names in option stat() without the e() part. For example, stat(rmse rss) will report the RMSE and RSS of the model. Please note that these statistics will be reported only if they are available in the e() macro. If they are not available, asdocx will highlight it as an error and report the given statistic as missing. All e() macros can be listed by typing ereturn list in Stata command window after a regression model. Some of the most commonly used e() statistics of regression models are as follows:

N     Number of observations. Reported by asdocx as default
r2    R-squared. Reported by asdocx as default
r2_a  Adjusted r-squared
F     F-statistics
rmse  RMSE
rss   Residual sum of squares
ll    Log-likelihood
chi2  Chi-square value

4.11 Set custom significance level for stars

The default significance levels for reporting stars are set at : *** for p-values <=0.01; ** for p-values <=0 .05, and * for p-values <=0.1. However, we can set our own levels for statistical significance using option setstars(). An example of setstars option looks like:

setstars(***@.01, **@.05, *@.1)

As we can see from the above line, setstars separates each argument by a comma. Each argument has three components. The first component is the symbol (in our case it is *) which will be reported for the given significance level. The second component is the @ sign that connects the significance level with the symbol. And the third component is the value at which the significance level is set. So if we want to report stars such that

* for p-value .001 or less
** for p-value .01 or less
*** for p-value .05 or less

We shall write the option setstars as

setstars(*@.001, **@.01, ***@.05)

An example would be:

sysuse auto, clear
asdocx reg price mpg rep78 headroom, ///  
replace setstars(*@.001, **@.01, ***@.05)

4.12 Suppressing stars [used with detailed regression tables] If we are not interested in reporting significance stars, we can use option nostars

4.13 Suppressing confidence intervals [used with detailed regression tables] If confidence intervals are not needed, we can use option noci

4.14 Confidence intervals at 99% [used with detailed regression tables] asdocx follows the Stata’s default to report confidence intervals at 95% level. However, one can change the level using the option level(##). So to use the confidence internal at 99%:

sysuse auto, clear
asdocx reg price mpg rep78 headroom, level(99)

4.15 eform [exponentiated coefficients] Option eform can be used to exponentiate coefficients or convert them to odd ratios in some regressions such as logit, etc.

4.16 label
By default, asdocx writes variable names as the row headers. Option label can be used to report variable labels instead of variable names.