Title
estout1 -- Yet another command to export estimation results
Table of contents
Syntax Description Options Remarks Examples
Syntax
estout1 [ namelist ] [ using filename ] [ , options ]
where namelist is _all | * | name [ name ...] name is identifier | .
options Description ------------------------------------------------------------------- Coefficients b(fmt_spec) set display format for coefficients se[(fmt_spec)] display standard errors t[(fmt_spec)] display t-values p[(fmt_spec)] display p-values eform report exponentiated coefficients abs use absolute t-values equations(eqmatchlist) match the models' equations keep(keeplist) keep individual regressors drop(droplist) drop individual regressors {se|t|p}keep(keeplist) keep certain individual results {se|t|p}drop(droplist) drop certain individual results nob suppress raw coefficients
Summary statistics stats(scalarlist) display summary statistics at the bottom of the table stfmt(fmtlist) set the display formats stlabels(stlabellist) label the summary statistics
Significance stars star[(thresholds)] attach "significance stars" (and define significance thresholds) starsym(starsymlist) define significance symbols starpos(b|se|t|p) determine position of thestars detachstar display the stars in their own column ststar(scalarlist) denote the overall model significance
Layout wide print table in wide format style(style) specifie a row style, where style is tab, tex or html begin(str) specify the beginning of the rows delimiter(str) specify the column delimiter end(str) specify the ending of the table rows varwidth(#) set width of the table's left stub modelwidth(#) set width of the results columns nohead suppress the table heading
Labelling label make use of variable labels conslbl(str) specify a label for the constant prehead(str_list) add text before the table heading posthead(str_list) add text after the table heading prefoot(str_list) add text before the table footer postfoot(str_list) add text after the table footer
Output replace overwrite an existing file append append the output to an existing file notype suppress the table in the results window -------------------------------------------------------------------
where fmt_spec is
%fmt parentheses | %fmt | parentheses
Description
estout1 assembles a table of coefficients, "significance stars", standard errors, t/z-statistics, p-values, and scalar statistics from one or more models previously fitted and stored by estimates store and writes the table to a text file specified by using and/or to the Stata log. The last estimated results may be referenced as a period (.) even if they have not yet been stored. If no model is specified, estout1 uses the last fitted model.
In general, estout1 works in a manner very similar to that of estimates table (in fact, estout1 calls estimates table internally). That is, estout1 "produces a table in which the coefficients are matched by the name of equation and coefficient; see option equations() to match equations by number. Each model in namelist is presented in a column of the table." And, estout1 "displays blanks in the table cells for those coefficients that are not in a particular model." However, it includes several additional features.
See help estimates for general information about managing estimation results.
Note that a newer, more capable version of this program is available as estout (available from the SSC Archive, type ssc describe estout).
+--------------+ ----+ Coefficients +-----------------------------------------------------
b(fmt_spec) specifies the display format for the coefficients (e.g. b(%9.0g)). It defaults to %9.3f.
se[(fmt_spec)] specifies that the standard errors of the coefficients be displayed below the coefficients (or beside them, see the wide option). A display format may be specified as an optional argument (e.g. se(%9.0g)). By default, the display format of the coefficients is used. Furthermore, the standard errors are displayed in parentheses if se(%fmt par) is specified (or se(par) if the default format is appropriate).
t[(fmt_spec)] specifies that the t- or z-values (coef/se(coef)) be displayed (see the description of se() above).
p[(fmt_spec)] specifies that the (two-sided) p-values of the coefficients be displayed (see the description of se() above). As is standard in Stata, the reference distribution is the t if the estimation command saved the residual degrees of freedom in e(df_r), and the normal distribution otherwise.
eform displays the coefficient table in exponentiated form. exp(b) is displayed rather than b (the untransformed coefficient) and standard errors are transformed. Unlike regress and estimates table, estout1 does not suppress the display of the intercept in eform-mode. To drop the intercept in eform-mode specify drop(_cons).
abs specifies that absolute t-values be used instead of regular t-values.
equations(matchlist) specifies how the equations of the models in namelist are to be matched. See the description in help estimates table.
keep(keeplist) specifies the coefficients to be included in the table. Option keep() may also be used to change the order of coefficients and equations. See the description in help estimates table.
drop(droplist) specifies the coefficients to be dropped from the table. See the description in help estimates table.
{se|t|p}keep(keeplist) or {se|t|p}drop(droplist) specifies that certain values be kept or dropped individually. For example, in a table of coefficients and t-values the specification tdrop(_cons) suppresses the t-values of the constants. On the other hand, tkeep(_cons) would display the t-values for the constants exclusively. A keeplist or droplist comprises one or more specifications, separated by white space. A specification is a variable name (e.g. price), an equation name (e.g. mean:), or a full name (e.g. mean:price).
Use keep() or drop() without a prefix (see above or help estimates table) if certain coefficients should be kept or dropped entirely or the order of coefficients and equations should be changed (e.g. type drop(_cons) if no information on the constants whatsoever should be displayed).
nob suppresses the display of the coefficients.
+--------------------+ ----+ Summary statistics +-----------------------------------------------
stats(scalarlist) specifies one or more scalar statistics to be displayed at the foot of the table. See the description given in help estimates table.
stfmt(fmtlist) specifies the display formats for the scalar statistics in stats(). For instance, stfmt(%9.3f %9.0f) would be good choice for stats(r2_a N). See help format. The first format in fmtlist will be used for the remaining scalars if scalarlist has more elements than fmtlist. Thus, only one format has to be specified if all scalars are supposed to have the same display format. If no format is specified, the default format is the display format of the coefficients.
stlabels(stlabellist) specifies labels for the scalars in stats(). If specified, the labels will be used instead of the scalar names. Example: stlabels("Adj. R-Square" "Number of Cases") for stats(r2_a N).
+--------------------+ ----+ Significance stars +-----------------------------------------------
star[(star_spec)] specifies that the significance of coefficients be denoted by stars: *: p<.05, **: p<.01, ***: p<.001. The optional star_spec may override these thresholds. For instance, star(0.10 0.05) specifies that significance stars are added to the coefficients using the following thresholds instead: *: p<.10 and **: p<.05. If star_spec specifies more than three thresholds, an appropriate list of symbols must be provided by starsym. For example, star(0.10 0.05 0.01 0.001) and starsym(+ * ** ***) would work. Note: The thresholds have to be specified in descending order.
starsym(starsymlist) specifies the symbols to be used to indicate significance levels. See description of star above. The default is starsym(* ** ***) (and starsym(*) or starsym(* **) if only one or two threshold levels are specified). starsym implies star.
starpos(b|se|t|p) specifies the position of the "significance stars". For example, starpos(t) means that the "significance stars" are connected to the t-values. Default is starpos(b), i.e. the stars are connected to the coefficients. Specifying starpos implies star.
detachstar specifies that a delimiter be placed between the coefficients and the significance stars (i.e. the stars will be displayed in their own column).
ststar(scalarlist) specifies that the overall significance of the model be denoted by stars. The stars will be attached to the scalar statistics specified in scalarlist. If scalarlist is empty, the stars will be attached to the first scalar statistic specified by stats(). The rules for the determination of the model significance are:
1) P-value provided: If the scalar e(p) is provided by the estimation command and if the value of e(p) lies between 0 and 1, e(p) will be interpreted as indicating the overall significance the model (p-value of the model).
2) F-Test: If e(p) is not provided, estout1 looks for the scalars e(df_m), e(df_r), and e(F) and the p-value of the model will be calculated as Ftail(df_m,df_r,F). This corresponds to the standard overall F-test of linear regression.
3) Chi2-Test: Otherwise, if neither e(p), nor e(F) is provided, estout1 looks for e(df_m) and e(chi2) and calculates the p-value as chi2tail(df_m,chi2). This p-value corresponds to the Likelihood-Ratio or Wald Chi2-Test.
3) If neither e(p) in [0,1], e(F), or e(chi2) are available, no overall significance stars will be reported.
Important note: Although the procedure outlined above is appropriate for most models, there might be some models for which it is not.
Hint: It is possible to attach the stars to different scalar statistics in one table. For example, specify ststar(r2_a r2_p) when tabulating OLS estimates and, say, probit estimates. For the OLS models, the F-test will be carried out and the significance stars will be attached to the r2_a; for the probit models the Chi2-test will be used and the stars will appear next to the r2_p.
+--------+ ----+ Layout +-----------------------------------------------------------
wide specifies that the table of coefficients be printed in wide format instead of long format, that is, that the b-, se-, t- and p-values be placed beside one another instead of beneath one another.
style(style) specifies a row style for the table rows. A row style is a named combination of values for the begin(), end(), and delimiter() options. The style options currently available are tex (begin: "", delimiter: "&", end: "\\"), html (begin: "<tr><td>", delimiter: "</td><td>", end: "</td></tr>"), and style tab (begin: "", delimiter: tab character, end: "").
begin(str) specifies a string to be printed at the beginning of every table row. The default is an empty string. Consider the remark on "Special characters" below.
delimiter(str) specifies the delimiter used between the table columns. The default is an empty string. See the remark on "Special characters" below.
end(str) specifies a string to be printed at the beginning of every table row. Default is an empty string. See the remark on "Special characters" below.
varwidth(#) specifies the width of the left stub of the table containing the variable names. varwidth defaults to 12, unless style(tab) is specified, in which case varwidth defaults to 0.
modelwidth(#) specifies width of the results columns. If specified, model names are abbreviated and short or empty results cells are padded out with blanks. modelwidth defaults to 12, unless style(tab) is specified, in which case modelwidth defaults to 0.
nohead suppresses the printing of the table head containing the model names.
+-----------+ ----+ Labelling +--------------------------------------------------------
label specifies that variable labels be displayed instead of variable names.
conslbl(str) may be used to specify a label for the constant. If specified, str will be displayed instead of _cons.
{pre|post}head(str_list) and {pre|post}foot(str_list) may be used to specify lists of lines of text to appear before/after the table head containing the model names and the table foot containing the scalar statistics. For example prehead("$S_DATE $S_TIME" "") would add a line containing the current date and time followed by an empty line before the table.
+--------+ ----+ Output +-----------------------------------------------------------
replace permits estout1 to overwrite an existing file.
append specifies that output be appended to an existing file. It may be used even if the file has not been previously created.
notype prevents estout1 from typing the table to the results window and the log file.
Remarks
Special characters: The \ and $ characters as well as quotation marks have special meanings in Stata. Thus, consider the following instructions if you, for example, intend to specify akward delimiters:
- Strings containing unmatched quotes should be enclosed in compound double quotes (thus, delimiter(`"""') results in columns delimited by ", while delimiter(") produces an error).
- The backslash character is used to delay macro expansion in Stata. Specifying \\ just results in \. To get a double backslash (the "\newline" command in TeX) type \\\ or \\\\ instead.
- The dollar sign is used for global macro expansion in Stata. Thus, $x would result in the display of the contents of global macro x (or nothing, if the macro does not exist). It is always safe to use \$ instead of $.
The tab character: The char() function may also be used to specify odd characters (help strfun). In particular, "`=char(9)'" results in a tab character. For example, delimiter(" `=char(9)' ") specifies a tab character with a leading and a trailing blank as delimiter. The char() function is also helpful if extra lines be added to the head or foot of the table. For example,
prehead("`=char(9)'Label 1`=char(9)'Label 2`=char(9)' ...")
may be used to add an extra row containing model labels. Multiple tabs are specified as "`=char(9)'`=char(9)' ...".
Examples
General usage:
. fit some model . est store A (store it) . fit another model . est store B (store it) . fit yet another model . est store C (store it)
. estout1 using filename (export coefficients from the last model)
. estout1 A B using filename (export coefficients from models A and B)
. estout1 A B using filename, star t(par) abs (add sign. stars and abs. t-values in parantheses)
. estout1 * using filename, stats(N ll chi2 df_m aic) (export all models with some additional statistics)
Coefficients, t-values, significance stars, and summary statistics:
. sysuse auto (1978 Automobile Data)
. regress price weight (output omitted)
. estimates store M1 . regress price weight turn rep78 (output omitted)
. estimates store M2 . estout1 M1 M2, star t(par) stats(r2_a N) M1 M2 weight 2.044*** 3.670*** (5.424) (5.300) turn -285.666* (-2.189) rep78 560.285 (1.725) _cons -6.707 4478.295 (-0.006) (1.056) r2_a 0.280 0.377 N 74.000 69.000
T-values for the first variable only:
. estout1 M1 M2, star t(par) tkeep(weight) M1 M2 weight 2.044*** 3.670*** (5.424) (5.300) turn -285.666* rep78 560.285 _cons -6.707 4478.295
Scalar statistics and overall significance only:
. estout1 M1 M2, nob stats(r2_a N) ststar M1 M2 r2_a 0.280*** 0.377*** N 74.000 69.000
Wide format:
. estout1 M2, star t wide M2 b t weight 3.670*** 5.300 turn -285.666* -2.189 rep78 560.285 1.725 _cons 4478.295 1.056
LaTeX-Table:
. estout1 M2, style(tex) p wide label conslbl(Constant) prehead("\begin{tabular}{lrr}" \hline) posthead(\hline) postfoot(\hline "\end{tabular}") varwidth(20) \begin{tabular}{lrr} \hline & M2& \\ & b& p\\ \hline Weight (lbs.) & 3.670& 0.000\\ Turn Circle (ft.) & -285.666& 0.032\\ Repair Record 1978 & 560.285& 0.089\\ Constant & 4478.295& 0.295\\ \hline \end{tabular}
Acknowledgements
Some of the code of estout1 and some of the text in this help file has been taken from the official est_table.ado and est_table.hlp.
I would like to thank Henriette Engelhardt and Elisabeth Coutts for helpful comments and suggestions.
Author
Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
Also see
Manual: [R] estimates
Online: help for estimates; estimates table; format; file