help esttabalso see:estout,eststo,estadd,estposthttp://repec.org/bocode/e/estout -------------------------------------------------------------------------------Titleesttab-- Display formatted regression tableSyntax Description Options Examples BackmatterTable of contentsSyntaxesttab[namelist] [usingfilename] [,options] wherenamelistis a name, a list of names, or_all. The*and?wildcards are allowed innamelist. A name may also be., meaning the current (active) estimates.optionsdescription ---------------------------------------------------------------------- Mainb(fmt)specify format for point estimatesbeta[(fmt)] display beta coefficients instead of point est'smain(name[fmt])display contents ofe(name)instead of point e'st(fmt)specify format for t-statisticsabsuse absolute value of t-statisticsnotsuppress t-statisticsz[(fmt)] display z-statistics (affects label only)se[(fmt)] display standard errors instead of t-statisticsp[(fmt)] display p-values instead of t-statisticsci[(fmt)] display confidence intervals instead of t-stat'saux(name[fmt])display contents ofe(name)instead of t-stat's []noconstantdo not/do report the intercept Significance stars [no]star[(list)] do not/do report significance starsstarauxattach stars to t-stat's instead of point est's Summary statisticsr2|ar2|pr2[(fmt)] display (adjusted, pseudo) R-squaredaic|bic[(fmt)] display Akaike's or Schwarz's information crit.scalars(list)display any other scalars contained ine()sfmt(fmt[...])set format(s) forscalars()noobsdo not display the number of observationsobslastplace the number of observations last Layoutwideplace point est's and t-stat's beside one anotheronecellcombine point est's and t-stat's in a single cell []noparenthesesdo not/do print parentheses around t-statisticsbracketsuse brackets instead of parentheses []nogapssuppress/add vertical spacing []nolinessuppress/add horizontal linesnoeqlinessuppress lines between equationscompressreduce horizontal spacingplainproduce a minimally formatted table Labelinglabelmake use of variable labelstitle(string)specify a title for the tablemtitles[(list)] specify model titles to appear in table headernomtitlesdisable model titles []nodepvarsdo not/do use dependent variables as model titles []nonumbersdo not/do print model numbers in table headercoeflabels(list)specify labels for coefficients []nonotessuppress/add notes in the table footeraddnotes(list)add lines at the end of the table Document formatsmcl|fixed|tab|csv|scsv|rtf|html|tex|booktabsset the document format (smclis the default)fragmentsuppress table opening and closing (LaTeX, HTML)page[(packages)] add page opening and closing (LaTeX, HTML)alignment(string)set alignment within columns (LaTeX, HTML, RTF)width(string)set width of table (LaTeX, HTML)longtablemulti-page table (LaTeX) Outputreplaceoverwrite an existing fileappendappend the output to an existing filetypeforce prining the table in the results windownoisilydisplay the executedestoutcommand Advanceddrop(list)drop individual coefficientskeep(list)keep individual coefficientsorder(list)change order of coefficientsequations(list)match the models' equationseformreport exponentiated coefficientsmarginreport marginal effects/elasticitiesunstackplace multiple equations in separate columnsestout_optionsany otherestoutoptions ----------------------------------------------------------------------Descriptionesttabis a wrapper forestout. It produces a pretty-looking publication-style regression table from stored estimates without much typing. The compiled table is displayed in the Stata results window or, optionally, written to a text file specified byusingfilename. Iffilenameis specified without suffix, a default suffix is added depending on the specified document format (".smcl" forsmcl, ".txt" forfixedandtab, ".csv" forcsvandscsv, ".rtf" forrft, ".html" forhtml, and ".tex" fortexandbooktabs).namelistprovides the names of the stored estimation sets to be tabulated. You may use the*and?wildcards innamelist. Ifnamelistis omitted,esttabtabulates the estimation sets stored byeststo(see helpeststo) or, if no such estimates are present, the currently active estimates (i.e. the model fit last). See helpestimatesfor information about storing estimation results. An alternative to theestimates storecommand is provided byeststo.esttabcan also be used to tabulate a Stata matrix applying syntaxesttabmatrix(name), wherenameis the name of the matrix. Furthermore, ane()-matrix orr()-matrix can be tabulated specifyingesttab e(name)oresttab r(name). Most options under the headings 'Main', 'Significance stars', and 'Summary statistics' are irrelevant in this case. See helpestoutfor further details on tabulating matrices.+------+ ----+ Main +-------------------------------------------------------------Optionsb(fmt)sets the numerical display format for the point estimates. The default format isa3. (See Numerical formats below for details on available formats.)beta[(fmt)] requests that standardized beta coefficients be displayed in place of the raw point estimates and, optionally, sets the display format (the default is to print three decimal places). Note thatbetacauses the intercept to be dropped from the table (unlessconstantis specified).main(name[fmt])requests that the statistics stored ine(name)be displayed in place of the point estimates and, optionally, sets the display format (the default is to use the display format for point estimates). For example,e(name)may contain statistics added byestadd(see helpestadd).t(fmt)sets the display format for t-statistics. The default is to display two decimal places.abscauses absolute values of t-statistics to be reported.notsuppresses the printing of t-statistics.z[(fmt)] requests that z-statistics be displayed. z-statistics are the same as t-statistics. Hence, specifyingzdoes not change the table contents, it only changes the label.se[(fmt)] requests that standard errors be displayed in place of t-statistics and, optionally, sets the display format (the default is to use the display format for point estimates).p[(fmt)] requests that p-values be displayed in place of t-statistics and, optionally, sets the display format (the default is to print three decimal places)ci[(fmt)] requests that confidence intervals be displayed in place of t-statistics and, optionally, sets the display format (the default is to use the display format for point estimates).level(#)assigns the confidence level, in percent. The default islevel(95)or as set byset level.aux(name[fmt])requests that the statistics stored ine(name)be displayed in place of t-statistics and, optionally, sets the display format (the default is to use the display format for point estimates). For example,e(name)may contain statistics added byestadd(see helpestadd, if installed).noconstantcauses the intercept be dropped from the table. Specifyconstantto include the constant in situations where it is dropped by default. +--------------------+ ----+ Significance stars +-----------------------------------------------star[(symbollevel[...])] causes stars denoting the significance of the coefficients to be printed next to the point estimates. This is the default. Typenostarto suppress the stars. The default symbols and thresholds are:*for p<.05,**for p<.01, and***for p<.001. Alternatively, for example, typestar(+ 0.10 * 0.05)to set the following thresholds:+for p<.10 and*for p<.05. Note that the thresholds must lie in the (0,1] interval and must be specified in descending order.starauxcauses the significance stars be printed next to the t-statistics (or standard errors, etc.) instead of the point estimates. +--------------------+ ----+ Summary statistics +-----------------------------------------------r2[(fmt)],ar2[(fmt)], andpr2[(fmt)] include the R-squared, the adjusted R-squared, and the pseudo-R-squared in the table footer and, optionally, set the corresponding display formats (the default is to display three decimal places).aic[(fmt)] andbic[(fmt)] include Akaike's and Schwarz's information criterion in the table footer and, optionally, set the corresponding display formats (the default is to use the display format for point estimates).scalars(list)may be used to add othere()-scalars to the table footer (typeereturn listto display a list of availablee()-scalars after fitting a model; see helpereturn). For example,scalars(df_m)would report the model degrees of freedom for each model.listmay be a simple list of names ofe()-scalars, e.g. . esttab, scalars(ll_0 ll chi2) or, alternatively, a list of quoted name-label pairs, e.g. . esttab, scalars("ll Log lik." "chi2 Chi-squared")sfmt(fmt[...])sets the display format(s) for the statistics specified inscalars()(the default is to use the display format for point estimates). Ifsfmt()contains less elements thanscalars(), the last specified format is used for the remaining scalars. That is, only one format needs to be specified if the same format be used for all scalars.noobssuppresses displaying information on the number of observations. The default is to report the number of observations for each model in the table footer.obslastdisplays the number of observations in the last row of the table footer. The default is to use the first row. +--------+ ----+ Layout +-----------------------------------------------------------widecauses point estimates and t-statistics (or standard errors, etc.) to be printed beside one another instead of beneath one another.onecellcauses point estimates and t-statistics (or standard errors, etc.) to be combined in a single table cell. This option is useful primarily inrtforhtmlmode. In these modes a line break is inserted between the two statistics. The benefit from usingonecellinrtforhtmlmode is that long coefficients labels do not derange the table layout. The default for other modes is to insert a blank between the statistics. Useestout'sincelldelimiter()option to change this.parenthesesencloses t-statistics (or standard errors, etc.) in parentheses. This is the default. Specifynoparenthesesto suppress the parentheses.bracketsuses square brackets, [], instead of parentheses. Note that brackets are the default for confidence intervals.gapsadds empty rows (or, more generally, additional vertical space) between coefficients to increase readability (empty rows are also inserted between the table's header, body, and footer, unlesslinesis activated). This is the default unlesswideornotis specified. Typenogapsto suppress the extra spacing.linesadds horizontal lines to the table separating the table's header, body, and footer and, in the case of multiple equation models, the equations. This is the default. Specifynolinesto suppress the lines. Lines are always suppressed in thetabandcsvmodes.noeqlinessuppresses the horizontal lines between equations in the case of multiple equation models.compressreduces the amount of horizontal spacing (so that more models fit on screen without line breaking). The option has no effect in thetabandcsvmodes. Furthermore, note that in the TeX and HTML modes thecompressoption only changes the arrangement the table's code, but not the look of the compiled end-product. Inrtf, however,compresschanges the look of the formatted table.plainproduces a minimally formatted table. It is a shorthand to specifyingnostar,nodepvars,nonumbers,noparentheses,nogaps,nolinesandnonotesand setting all formats to%9.0g. Note that the disabled options can be switched on again. For example, type . esttab, plain star to produce a plain table including significance stars. +----------+ ----+ Labeling +---------------------------------------------------------labelspecifies that variable labels be used instead of variable names (and estimation set titles be used instead of estimation set names). Furthermore,labelprints "Constant" instead of "_cons".title(string)may be used to provide a title for the table. If specified,stringis printed at the top of the table. Note that specifying a title causes the table to be set up as a floating object in LaTeX mode. You may want to set a label for referencing in this case. For example, if you typetitle(...\label{tab1}), then "\ref{tab1}" could be used in the LaTeX document to point to the table.mtitles, without argument, specifies that for each model the title (or, if empty, the name) of the stored estimation set be printed as the model's title in the table header. Ifmtitlesis omitted, the default is to use name or label of the dependent variable as the model's title (see thedepvaroption). Alternatively, usemtitles(list)specifies a list of model titles. Enclose the titles in double quotes if they contain spaces, e.g.mtitles("Model 1" "Model 2").nomtitlessuppresses printing of model titles.depvarsprints the name (or label) of the (first) dependent variable of a model as the model's title in the table header. This is the default. Specifynodepvarsto use the names of the stored estimation sets as titles.numbersincludes a row containing consecutive model numbers in the table header. This is the default. Specifynonumbersto suppress printing the model numbers.coeflabels(namelabel[...])specifies labels for the coefficients. Specify names and labels in pairs and, if necessary, enclose labels in double quotes, e.g.coeflabels(mpg Milage rep78 "Repair Record").notesprints notes at the end of the table explaining the significance symbols and the type of displayed statistics. This is the default. Specifynonotesto suppress the notes.addnotes(list)may be used to add further lines of text at the bottom of the table. Lines containing blanks must be enclosed in double quotes, e.g.addnotes("Line 1" "Line 2"). +-----------------+ ----+ Document format +--------------------------------------------------smcl,fixed,tab,csv,scsv,rtf,html,tex, andbooktabschoose the table's basic output format. The default format issmclunlessusingis specified, in which case the default format depends on the filename's suffix (smclfor ".smcl",csvfor ".csv",rtffor ".rtf",htmlfor ".htm" or ".html",texfor ".tex", andfixedfor all other filenames).smclproduces a SMCL formatted table to be displayed in the Stata results window or the Stata viewer.fixedproduces a fixed-format ASCII table. This is suitable, for example, if the table be displayed in a text editor.tabproduces a tab-delimited ASCII table.csvproduces a CSV (CommaSeparatedValue format) table for use with Microsoft Excel. Delimiter is a comma. In order to prevent Excel from interpreting the contents of the table cells, they are enclosed double quotes preceded by an equal sign (i.e. ="..."). However, if theplainoption is specified, the table cells are enclosed in double quotes without the leading equal sign. The first method is appropriate if you want to preserve the table's formatting. The second method is appropriate if you want to use the table's contents for further computations in Excel.scsvis a variant on the CSV format that uses a semicolon as the delimiter. This is appropriate for some non-English versions of Excel (e.g. the German version).rtfproduces a Rich Text Format table for use with word processors.htmlproduces a simple HTML formatted table.texproduces a LaTeX formatted table.booktabsproduces a LaTeX formatted table for use with LaTeX'sbooktabspackage.fragmentcauses the table's opening and closing specifications to be suppressed. This is relevant primarily in LaTeX and HTML mode.page[(packages)] adds opening and closing code to define a whole LaTeX or HTML document. The default is to produce a raw table that can then be included into an existing LaTeX or HTML document. Specifyingpackagesin parentheses causes\usepackage{packages}to be added to the preamble of the LaTeX document (note that thebooktabspackage is automatically loaded ifbooktabsis specified).alignment(string)may be used to specify the alignment of the models' columns in LaTeX, HTML, or RTF mode. In LaTeX modestringshould be a LaTeX column specifier. The default is to center the columns. To produce right-aligned columns, for example, typealignment(r). If the table contains multiple columns per model/equation, the alignment specification should define all columns. For example, if thewideoption is specified, you could typealignment(cr)to, say, center the point estimates and right-align the t-statistics. Note that more sophisticated column definitions are often needed to produce appealing results. In particular, LaTeX'sdcolumnpackage proves useful to align columns on the decimal point. In HTML modestringshould be a HTML alignment specifier. The default is to omit alignment specification, which results in left aligned columns. To center the columns in HTML, for example, specifyalignment(center). Other than in LaTeX mode, the same alignment is used for all columns if the table contains multiple columns per model/equation in the HTML mode. In RTF modestringshould be one ofl,c,r, andj. The default is to center the columns. To produce right-aligned columns, for example, typealignment(r). The same alignment is used for all columns if the table contains multiple columns per model/equation in the RTF mode. Note thatalignment()does not change the alignment of the variable names/labels in the left stub of the table. They are always left-aligned.width(string)sets the overall width of the table in LaTeX or HTML.stringshould be LaTeX or HTML literal. For example, specifywidth(\hsize)in LaTeX orwidth(100%)in HTML to span the whole page. The table columns will spread regularly over the specified width. Note that in RTF modeestout'svarwidth()andmodelwidth()options may be used to change the width of the table columns.longtablecauses thelongtableenvironment to be used in LaTeX. Uselongtablefor tables that are too long to fit on a single page.longtablecannot be combined withwidth(). Make sure to load thelongtablepackage in the LaTeX document, i.e. include\usepackage{longtable}in the document's preamble. +--------+ ----+ Output +-----------------------------------------------------------replacepermitsesttabto overwrite an existing file.appendspecifies that the output be appended to an existing file. It may be used even if the file does not yet exist. Specifyingappendtogether withpagein TeX or HTML mode causes the new table to be inserted at the end of the body of an existing document (esttabseeks a line reading "\end{document}" or "</body>", respectively, and starts appending from there; contents after this line will be overwritten). In RTF mode, existing documents are assumed to end with a line containing a single "}".typespecifies that the assembled table be printed in the results window and the log file. This is the default unlessusingis specified.noisilydisplays the executedestoutcommand. +----------+ ----+ Advanced +---------------------------------------------------------drop(droplist)identifies the coefficients to be dropped from the table. Adroplistcomprises one or more specifications, separated by white space. A specification can be either a parameter name (e.g.price), an equation name followed by a colon (e.g.mean:), or a full name (e.g.mean:price). You may use the*and?wildcards in equation names and parameter names. Be sure to refer to the matched equation names, and not to the original equation names in the models, when using theequations()option to match equations.keep(keeplist)selects the coefficients to be included in the table.keeplistis specified analogous todroplistindrop()(see above).order(orderlist)changes the order of the coefficients and equations within the table.orderlistis specified analogous todroplistindrop()(see above). Coefficients and equations that do not appear inorderlistare placed last (in their original order).equations(eqmatchlist)specifies how the models' equations are to be matched. This option is passed to the internal call ofestimatestable. See helpestimateson how to specify this option. The most common usage isequations(1)to match all the first equations in the models.eformdisplays the regression table in exponentiated form. The exponent of a coefficient is displayed in lieu of the untransformed coefficient; standard errors and confidence intervals are transformed as well. Note that the intercept is dropped in eform-mode, unlessconstantis specified.marginindicates that the marginal effects or elasticities be reported instead of the raw coefficients. A prerequisite for this option to work correctly is thatmfxhas been applied to a model prior to storing its results (see helpmfx). Note that the standard errors, etc. are transformed as well. Furthermore, the intercept is dropped, unlessconstantis specified.unstackspecifies that the individual equations from multiple-equation models (e.g.mlogit,reg3,heckman) be placed in separate columns. The default is to place the equations below one another in a single column.estout_optionsare any otherestoutoptions (see helpestout). Note thatestoutoptions take precedence overesttaboptions. For example,cells()disablesb(),beta(),main(),t(),abs,not,se(),p(),ci(),aux(),star,staraux,wide,onecell,parentheses, andbrackets,stats()disablesr2(),ar2(),pr2(),aic(),bic(),scalars(),sfmt(),noobs, andobslast. Otherestoutoptions that should be used with care arebegin(),delimiter(),end(),prehead(),posthead(),prefoot(),postfoot(),mlabels(), andvarlabels(). +-------------------+ ----+ Numerical formats +------------------------------------------------ Numerical display formats may be specified inesttabas follows: 1. Official Stata's display formats: You may specify formats, such as%9.0gor%8.2f. See help format for a list of available formats.%gorgmay be used as a synonym for%9.0g. 2. Fixed format: You may specify an integer value such as0,1,2, etc. to request a display format with a fixed number of decimal places. For example,t(3)would display t-statistics with three decimal places. 3. Automatic format: You may specifya1,a2, ..., ora9to causeesttabto choose a reasonable display format for each number depending on the number's value.amay be used as a synonym fora3. The#ina#determines the minimum precision according to the following rules: o Absolute numbers smaller than 1 are displayed with#significant decimal places (i.e. with#decimal places ignoring any leading zeros after the decimal point). For example,0.00123456is displayed as0.00123if the format isa3. o Absolute numbers greater than 1 are displayed with as many digits required to retain at least one decimal place and are displayed with a minimum of (#+ 1) digits. For example, if the format isa3,1.23456is displayed as1.235,12.3456is displayed as12.35, and1234.56is displayed as1234.6. o In any case, integers are displayed with zero decimal places, and very large or very small absolute numbers are displayed in exponential format.The following examples are intended to illustrate the basic usage ofExamplesesttab. Additional examples can be found at http://repec.org/bocode/e/estout. The procedure is to first fit and store some models (seeeststo) and then applyesttabto these stored estimates: . eststo clear . sysuse auto (1978 Automobile Data) . eststo: quietly regress price weight mpg (est1stored) . eststo: quietly regress price weight mpg foreign (est2stored) . esttab, ar2-------------------------------------------- (1) (2) price price -------------------------------------------- weight1.747** 3.465***(2.72)(5.49)mpg-49.51 21.85(-0.57)(0.29)foreign3673.1***(5.37)_cons1946.1 -5853.7(0.54)(-1.73)-------------------------------------------- N74 74adj. R-sq0.273 0.478-------------------------------------------- t statistics in parentheses * p<0.05, ** p<0.01, *** p<0.001 The same table using labels: . esttab, ar2 label---------------------------------------------------- (1) (2) Price Price ---------------------------------------------------- Weight (lbs.)1.747** 3.465***(2.72)(5.49)Mileage (mpg)-49.51 21.85(-0.57)(0.29)Car type3673.1***(5.37)Constant1946.1 -5853.7(0.54)(-1.73)---------------------------------------------------- Observations74 74Adjusted R-squared0.273 0.478---------------------------------------------------- t statistics in parentheses * p<0.05, ** p<0.01, *** p<0.001 Plain table: . esttab, ar2 plainest1 est2 b/t b/t weight1.746559 3.4647062.723238 5.493003mpg-49.51222 21.8536-.5746808 .2944391foreign3673.065.370142_cons1946.069 -5853.696.541018 -1.733408N74 74adj. R-sq.2734846 .4781119Using standard errors in brackets and suppress significance stars: . esttab, se nostar brackets-------------------------------------- (1) (2) price price -------------------------------------- weight1.747 3.465[0.641][0.631] mpg-49.51 21.85[86.16][74.22] foreign3673.1[684.0] _cons1946.1 -5853.7[3597.0][3377.0] -------------------------------------- N74 74-------------------------------------- Standard errors in brackets Printing beta coefficients: . esttab, beta-------------------------------------------- (1) (2) price price -------------------------------------------- weight0.460** 0.913***(2.72)(5.49)mpg-0.097 0.043(-0.57)(0.29)foreign0.573***(5.37)-------------------------------------------- N74 74-------------------------------------------- Standardized beta coefficients; t statistics in parentheses * p<0.05, ** p<0.01, *** p<0.001Ben Jann, ETH Zurich, jannb@ethz.chAuthorManual:Also see[R] estimatesOnline: help forestimates, estcom,estout,eststo,estadd,estpost