help estoutalso see:esttab,eststo,estadd,estposthttp://repec.org/bocode/e/estout -------------------------------------------------------------------------------Titleestout-- Making regression tables from stored estimatesSyntax Description Options Examples Remarks Saved results BackmatterTable of contentsSyntaxestout[what] [usingfilename] [,options]whatdescription ----------------------------------------------------------------------namelisttabulate stored estimation sets;namelistis a name, a list of names, or_all; the*and?wildcards are allowed; a name may also be., meaning the current (active) estimatesmatrix(name[,subopts])tabulate matrixnamee(name[,subopts])tabulate matrixe(name)r(name[,subopts])tabulate matrixr(name)subopts:fmt(fmtlist)set the display format(s)transposetabulate transposed matrix ----------------------------------------------------------------------optionsdescription ---------------------------------------------------------------------- Parameter statisticscells(elements and subopts)contents of the table cells, where anelement'ssuboptsare in paren- theses, i.e.element[(subopts)]elements:braw coefficient (point estimate)sestandard errorvarvariancett or z statisticzt or z statistic (synonym fort)pp-valueciconfidence intervalci_llower bound of confidence intervalci_uupper bound of confidence interval_star"significance stars"_signsign of point estimate_sigsignsign and significance of estimate.null element (empty cell)&combine elements in single cellmyelresults frome(myel)myel[#]results from row#ine(myel)myel[rowname]results from rowrownameine(myel)subopts(for eachelement, except for.and&): []nostarattach "significance stars"fmt(fmt[fmt...])set the display format(s)label(string)define a label forelementpar[(lr)] |noparplace results in parenthesesvacant(string)printstringif coefficient is absentdrop(droplist)drop certain individual resultskeep(keeplist)keep certain individual resultspattern(pattern)model selectionpvalue(name)set p-values forstar(default:p) [no]absuse absolute t-statistics []notransposetransposee(myel)for tabulationdrop(droplist)drop individual coefficients []noomittedinclude omitted coefficients []nobaselevelsinclude base levelskeep(keeplist)keep individual coefficientsorder(orderlist)change order of coefficientsindicate(groups[,subopt])indicate presence of parameterssubopt:labels(yesno)redefine "Yes" and "No" labelsrename(oldnew[oldnew...])rename individual coefficientsequations(eqmatchlist)match the models' equationseform[(pattern)] |noeformreport exponentiated coefficientstransform(list[,subopt])apply transformations to coefficientssubopt:pattern(pattern)])select modelsmargin[(u|c|p)] |nomarginreport marginal effects aftermfxdiscrete(string)|nodiscreteidentify 0/1 variables (ifmargin)meqs(eq_list)select equations for marginal effectsdropped[(string)] |nodroppedindicate null coefficients as droppedlevel(#)set level for confidence intervals Summary statisticsstats(scalarlist[,subopts])display summary statistics at the bottom of the tablesubopts:fmt(fmt[fmt...])set the display formatslabels(strlist[,label the summary statisticslabel_subopts])star[(sca'list)] |nostardenote the model significancelayout(array)arrange the summary statisticspchar(symbol)placeholder inlayout(); default is@Significance starsstarlevels(levelslist)define thresholds and symbols, where 'levelslist' is 'symbol#[symbol#...]' with#in (0,1] and listed in descending orderstardrop(droplist)drop stars for individual coefsstarkeep(keeplist)keep stars for individual coefs []nostardetachdisplay the stars in their own column Layoutvarwidth(#)set width of the table's left stubmodelwidth(#[#...])set width of the results columns []nounstackplace equations from multiple- equation models in separate columnsbegin(string)specify the beginning of the rowsdelimiter(string)specify the column delimiterend(string)specify the ending of the table rowsincelldelimiter(string)specify delimiter within celldmarker(string)define the decimal markermsign(string)define the minus sign [no]lzprint the leading zero of fixed format numbers in (-1,1)extracols(numlist)add empty column to the tablesubstitute(subst)apply end-of-pipe substitutions, where 'subst' is 'fromto[fromto... ]' Labeling []nolabelmake use of variable labels []noabbrevabbreviate long names and labels []nowrapwrap long labels (if space permits)interaction(string)specify interaction operatortitle(string)specify a title for the tablenote(string)specify a note for the table []nolegendadd a significance symbols legendprehead(strlist)add text before the table headingposthead(strlist)add text after the table headingprefoot(strlist)add text before the table footerpostfoot(strlist)add text after the table footerhlinechar(string)specify look of@hlinevarlabels(matchlist[,sub.])relabel the parameterssubopts:blist(matchlist)assign prefixes to certain rowselist(matchlist)assign suffixes to certain rowslabel_suboptslabcol2(strlist[,subopts])add a second labeling columnsubopts:title(strlist)add column title in table headerwidth(#)set width of columnrefcat(matchlist[,subopts])add reference category informationsubopts:label(string)|nolabelredefine the "ref." labelbelowchange positioning of refcatmlabels(strlist[,subopts])label the modelssubopts: []nodepvarsuse the name/label of the dependent variable as model label []notitlesuse estimates title as model label []nonumbersnumber models labels consecutivelylabel_suboptscollabels(strlist[,label the columns within modelslabel_subopts])eqlabels(strlist[,subopts])label the equationssubopts: []nomergemerge equation and parameter labelslabel_suboptsmgroups(strlist[,subopts])define and label groups of modelssubopts:pattern(pattern)define the grouping of the modelslabel_suboptsnumbers[(lr)] |nonumbersadd a row containing model numbers Output []noreplaceoverwrite an existing file []noappendappend the output to an existing file []notypeprint the table in the results window [no]showtabsdisplay tabs as<T>stopfile(filename)insert file contents above tablebottomfile(filename)insert file contents below table Defaultsstyle(style)specify a style for the output tablestyles:smclSMCL formatted table (screen default)tabtab delimited table (export default)fixedfixed format tabletextable for use with LaTeXhtmltable for use with HTMLmystyleuser defined addition ----------------------------------------------------------------------label_suboptsDescription ---------------------------------------------------------------------- [no]nonesuppress the labelsprefix(string)add a common prefixsuffix(string)add a common suffixbegin(strlist)add an overall prefix []nofirstprint the first occurrence ofbegin()end(strlist)add an overall suffix []nolastprint the last occurrence ofend()replacereplace globalbegin()/end()[no]spanspan columns if appropriateerepeat(string)add a "span" suffixlhs(string)label the table's left stub ----------------------------------------------------------------------Descriptionestoutassembles a table of coefficients, "significance stars", summary statistics, standard errors, t- or z-statistics, p-values, confidence intervals, and other statistics for one or more models previously fitted and stored byestimates storeoreststo. It then displays the table in Stata's results window or writes it to a text file specified byusing. The default is to use SMCL formatting tags and horizontal lines to structure the table. However, ifusingis specified, a tab-delimited table without lines is produced.namelistprovides the names of the stored estimation sets to be tabulated. You may use the*and?wildcards innamelist. The results estimated last may be indicated by a period (.), even if they have not yet been stored. If no model is specified,estouttabulates the estimation sets stored byeststo(see helpeststo) or, if no such estimates are present, the currently active estimates (i.e. the model fit last).estoutmay be used after any estimation command that returns its results ine(). See the Introduction in the Examples section for an introduction on usingestout. See helpestimatesfor general information about managing estimation results. Furthermore, see helpeststofor an alternative to theestimates storecommand. The default forestoutis to produce a plain table containing point estimates. Producing a fully formatted end-product may involve specifying many options. However, note that a simple-to-useestoutwrapper producing pre-formatted publication style tables is available asesttab. Furthermore, useestaddto make additional results available for tabulation (such as the standardized coefficients or the means and standard deviations of the regressors) andestpostto tabulate results from non-estimation commands such assummarizeortabulate.estoutcan also be used to tabulate the contents of a Stata matrix (see helpmatrix). Typeestout marix(name), wherenameis the name of the matrix, instead of providing anamelistof stored estimation sets. See the examples below. Alternatively, you may also specifye(name)orr(name)to tabulate ane()-matrix or anr()-matrix. Thecells()option is disabled if tabulating a matrix. Programms similar toestoutincludeoutregby John Luke Gallup,outreg2by Roy Wada,modltblby John H. Tyler,mktabby Nicholas Winter,outtexby Antoine Terracol, orest2texby Marc Muendler. Also see Newson (2003) for a very appealing approach.Contents Parameter statistics Summary statistics Significance stars Layout Labeling Output DefaultsOptionslabel_suboptsmatrix_subopts+----------------------+ ----+ Parameter statistics +---------------------------------------------cells(array)specifies the parameter statistics to be reported and how they are to be arranged. The default is for cells to report point estimates only, i.e.cells(b).cells(none)may be used to completely suppress the printing of parameter statistics. Alternatively,cells(b se)would result in the reporting of point estimates and standard errors. Multiple statistics are placed in separate rows beneath one another by default. However, elements ofarraythat are listed in quotes or in parentheses, e.g."b se"or`"b se"'or(b se), are placed beside one another. For example,cells("b p" se)or, equivalently,cells((b p) se)would produce a table with point estimates and p-values beside one another in first row and standard errors in the second row beneath the point estimates. The parameter statistics available areb(point estimates),se(standard errors),var(variance),t(t/z-statistics),z(synonym fort),p(p-values), andci(confidence intervals; to display the lower and upper bounds in separate cells useci_landci_u). Any additional parameter statistics included in thee()-returns for the models can be tabulated as well. If, for example,e(beta)contains the standardized coefficients, typecells(beta)to tabulate them (useestaddto add statistics such as the standardized coefficients to thee()-returns of a model). The syntaxname[#]orname[rowname]can be used to refer to specific rows ine(name). For example, typecell(ci_bc[1] ci_bc[2])orcell(ci_bc[ll] ci_bc[ul])to tabulate the lower and upper bounds of the bias-corrected confidence intervals afterbootstrap. The default is to report the results from the first row. Also see theeformandtransform()options for more information on the kinds of statistics that can be displayed. Further available elements inarrayare_star,_sign, and_sigsign._starcauses stars denoting the significance of the coefficients to be printed (* for p<.05, ** for p<.01, and *** for p<.001; customizable via thestarlevels()option below)._starplaces the significance stars in their own cells. See thestarsuboption below if you want to attach the stars to another element._signprints the signs of the coefficients ("+", "-", or "0")._sigsign, a combination of_starand_sign, repeats the signs of the coefficients where the number of repetitions reflects the level of significance (non-significant coefficients are left empty; however, you may set the first level to 1 in thestarlevels()option). Finally,.and&may be used inarray..inserts a "null" element. Use this to add empty cells. For example,cells("b p" ". se")would produce a table with point estimates in the first column and p-values and standard errors beneath one another in the second column.&is used to combine elements in the same cell. Use theincelldelimiter()option to specify the text to be printed between the combined elements (the default is to print a single blank). For example, in HTML, usecell(b & se)andincelldelimiter(<br>)to include point estimates and standard errors in a single cell and insert a line break between them. A set of suboptions may be specified in parentheses for each element named inarray(except for.and&). For example, to add significance stars to the coefficients and place the standard errors in parentheses, specifycells(b(star) se(par)). The following suboptions are available. Use:starto specify that stars denoting the significance of the coefficients be attached to the statistic:*for p<.05,**for p<.01, and***for p<.001. The symbols and the values for the thresholds and the number of levels are fully customizable (see the Significance stars options).fmt(fmt[fmt...])to specify the display format(s) of a statistic. It defaults to%9.0gor the format for the first statistic incells(). If only one format is specified, it is used for all occurrences of the statistic. For example, type . estout..., cells("b(fmt(3)) t(fmt(2))") to print coefficients and t-values beside one another using three decimal places for coefficients and two decimal places for t-values. If multiple formats are specified, the first format is used for the first regressor in the estimates table, the second format for the second regressor, and so on. The last format is used for the remaining regressors if the number of regressors in the table is greater than the number of specified formats. For instance, type . estout..., cells(b(fmt(3 4 2))) to use three decimal places for the first coefficient, four decimal places for the second, and two decimal places for all remaining coefficients. Note that, regardless of the display format chosen, leading and trailing blanks are removed from the numbers. White space can be added by specifying amodelwidth()(see the Layout options).fmtmay be any of Stata's numerical display formats, e.g.,%9.0gor%8.2f, an integer#such as1or3to use a fixed format with#decimal places, ora#such asa1ora3to useestout's adaptive display format (see Numerical formats in the Remarks section for details).label(string)to specify a label to appear in the column heading. The default is the name of the statistic.par[(lr)] to specify that the statistic in question be placed in parentheses. It is also possible to specify custom "parentheses". For example,se(par({ }))would display the standard errors in curly brackets. Or,se(par(`"="("'`")""'))will write parentheses in a way that Excel can recognize. Forcithe syntax is:ci(par[(lmr)])vacant(string)to printstringif a coefficient is not in the model. The default is to leave such cells empty.drop(droplist[, relax])to cause certain individual statistics to be dropped. For example, specifyingt(drop(_cons))suppresses the t-statistics for the constants.droplistis specified as in the globaldrop()option (see below).keep(keeplist[, relax])to cause certain individual statistics to be kept. For example, the specificationt(keep(mpg))would display the t-statistics exclusively for the variablempg.keeplistis specified analogous todroplistindrop()(see below).pattern(pattern)to designate a pattern of models for which the statistics are to be reported, where thepatternconsists of zeros and ones. A1indicates that the statistic be printed;0indicates that it be suppressed. For examplebeta(pattern(10 1))would result inbetabeing reported for the first and third models, but not for the second.pvalue(name)to specify the p-values used to determine the significance stars (seestarabove). The default ispvalue(p), indicating that the standard p-values are to be used (i.e. the p-values computed form the coefficients vector and the variance matrix). Alternatively, specifypvalue(mypvalue), in which case the significance stars will be determined from the values ine(mypvalue). Values outside [0,1] will be ignored.absto specify that absolute t-statistics be used instead of regular t-statistics (relevant only if used witht()).transposeto specify thate(myel)be transposed for tabulation.drop(droplist[, relax])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. Specify therelaxsuboption to allowdroplistto contain elements for which no match can be found.omittedincludes omitted coefficients (only relevant in Stata 11 or newer). This is the default. Typenoomittedto drop omitted coefficients.baselevelsincludes base levels of factor variables (only relevant in Stata 11 or newer). This is the default. Typenobaselevelsto drop base levels of factor variables.keep(keeplist[, relax])selects the coefficients to be included in the table.keeplistis specified analogous todroplistindrop()(see above). Note thatkeep()doesnotchange the the order of the coefficients. Useorder()to change the order of coefficients.order(orderlist)changes the order of the coefficients and equations within the table.orderlistis specified analogous todroplistindrop()(see above). Reordering of coefficients is performed equation by equation, unless equations are explicitly specified. Coefficients and equations that do not appear inorderlistare placed last (in their original order). Extra table rows are inserted for elements inorderlistthat are not found in the table.indicate(groups[,labels(yesno)])indicates for each model (or, ifunstackis specified, for each equation) the presence of certain groups of coefficients at the end of the table body. The syntax forgroupsis "group" [ "group"...] where agroupis [name= ]listandlistis a list of coefficient specifications as defined indrop()above. The single groups should be enclosed in quotes unless there is only one group andnameis specified. Note thatnamemay contain spaces. For example, if some of the models contain a set of year dummies, sayy1 y2 y3, specify estout..., indicate(year effects = y1 y2 y3) to drop the dummies from the table and add a "year effects" row containing "Yes" for models in whichat least oneof the dummies is present, and "No" for the other models. Furthermore, if some models also contain a set of region dummies, sayreg_1throughreg_17, you could type estout..., indicate("years = y1 y2 y3" "regions = reg_*") Use thelabels()suboption to redefine the indication labels to be printed in the table. The default islabels(Yes No). Use quotes if the labels include spaces, e.g.labels("in model" "not in model").rename(matchlist)changes the names of individual coefficients, wherematchlistisoldnamenewname[oldnamenewname...]oldnamecan be a parameter name (e.g.price) or a full name including an equation specification (e.g.mean:price) (abbreviation and wildcards not allowed);newnameis a name without equation specification and must not already occur in a model's equation.rename()is applied before matching the models and equations and can therefore be used to merge different coefficients across models (or equations ifunstackis specified) into a single table row. See thevarlabels()option if you are interested in relabeling coefficients after matching models and equations.equations(matchlist)specifies how the models' equations are to be matched. The default is to match all first equations into one equation (namedmain, if the equations have different names) and match the remaining equations by name. Specifyequations("")to match all equations by name. Alternatively, specifymatchlist, which has the syntaxterm[,term... ] wheretermis [eqname=]#:#...:#(syntax 1) [eqname=]#(syntax 2) In syntax 1, each#is a number or a period (.). If a number, it specifies the position of the equation in the corresponding model;1:3:1would indicate that equation 1 in the first model matches equation 3 in the second, which matches equation 1 in the third. A period indicates that there is no corresponding equation in the model;1:.:1indicates that equation 1 in the first matches equation 1 in the third. In syntax 2, you specify just one number, say,1or2, and that is shorthand for1:1...:1or2:2...:2, meaning that equation 1 matches across all models specified or that equation 2 matches across all models specified.eqnameis used to name the matched equations. If it is suppressed, a name such as#1or#2etc. is used, depending on the position of theterm. For example,equations(1)indicates that all first equations are to be matched into one equation named#1. All equations not matched by position are matched by name.eform[(pattern)] displays the coefficient table in exponentiated form. The exponent ofbis displayed in lieu of the untransformed coefficient; standard errors and confidence intervals are transformed as well. Specify apatternif the exponentiation is to be applied only for certain models. For instance,eform(1 0 1)would transform the statistics for Models 1 and 3, but not for Model 2. Note that, unlikeregressandestimates table,estoutin eform-mode does not suppress the display of the intercept. To drop the intercept in eform-mode, specifydrop(_cons). Note:eformis implemented via thetransform()option. If both options are specified,transform()takes precedence overeform.transform(list[,pattern(pattern)])displays transformed coefficients, standard errors and confidence intervals.listmay befxdfxwherefxis the transformation function anddfxis its first derivative.fxis applied to coefficients and confidence intervals, that is,fx(b) andfx(ci) is displayed instead ofbandci.dfxis used to delta transform standard errors, i.e.se*dfx(b) is displayed instead ofse. Use@as a placeholder for the function's argument infxanddfx. For example, type estout..., transform(exp(@) exp(@)) to report exponentiated results (this is equivalent to specifying theeformoption). Alternatively,listmay be specified ascoefsfxdfx[...[coefs]fxdfx] wherecoefsidentifies the coefficients to be transformed. Syntax forcoefsis as explained above in the description of thedrop()option (however, includecoefsin quotes if it contains multiple elements). Say, a model has two equations,priceandselect, and you want to exponentiate thepriceequation but not theselectequation. You could then type estout..., transform(price: exp(@) exp(@)) Note that omittingcoefin the last transformation specification causes the last transformation to be applied to all remaining coefficients. Specify thepattern()suboption if the transformations are to be applied only for certain models. For instance,pattern(1 0 1)would apply the transformation to Models 1 and 3, but not Model 2.margin[(u|c|p)] indicates that the marginal effects or elasticities be reported instead of the raw coefficients. This option has an effect only ifmfxhas been applied to a model before its results were stored (see helpmfx) or if adprobit(see helpprobit),truncreg,marginal(helptruncreg), ordtobit(Cong 2000) model is estimated. One of the parametersu,c, orp, corresponding to the unconditional, conditional, and probability marginal effects, respectively, is required fordtobit. Note that the standard errors, confidence intervals, t-statistics, and p-values are transformed as well. Using themarginoption with multiple-equation models can be tricky. The marginal effects of variables that are used in several equations are printed repeatedly for each equation because the equations per se are meaningless formfx. To display the effects for certain equations only, specify themeqs()option. Alternatively, use thekeep()anddrop()options to eliminate redundant rows. Theequations()option might also be of help here. As of Stata 11, the use ofmfxis no longer suggested, sincemfxhas been superseded bymargins. Results frommarginscan directly be tabulated byestoutas long as thepostoption is specified withmargins. Alternatively, you may add results frommarginsto an existing model usingestadd marginsorestpost margins. See the examples on tabulating results frommarginsat http://repec.org/bocode/e/estout/advanced.html.discrete(string)may be used to override the default symbol and explanatory text used to identify dummy variables when applying themarginoption. The first token instringis used as the symbol. The default is: discrete(" (d)" for discrete change of dummy variable from 0 to 1) To display explanatory text, specify either thelegendoption or use the@discretevariable (see the Remarks on using @-variables). Usenodiscreteto disable the identification of dummy variables as such. The default is to indicate the dummy variables unless they have been interpreted as continuous variables in all of the models for which results are reported (fordprobitanddtobit, however, dummy variables will always be listed as discrete variables unlessnodiscreteis specified).meqs(eq_list)specifies that marginal effects requested by themarginoption be printed only for the equations ineq_list. Specifying this option does not affect how the marginal effects are calculated. Aneq_listcomprises one or more equation names (without colons) separated by white space. If you use theequations()option to match equations, be sure to refer to the matched equation names and not to the original equation names in the models.dropped[(string)] causes null coefficients (coefficients for whiche(b)ande(V)is zero) to be indicated as dropped.stringspecifies the text to be printed in place of the estimates. The default text is "(dropped)".level(#)assigns the confidence level, in percent, for the confidence intervals of the coefficients (see help level). +--------------------+ ----+ Summary statistics +-----------------------------------------------stats(scalarlist[,stats_subopts])specifies one or more scalar statistics - separated by white space - to be displayed at the bottom of the table. Thescalarlistmay contain numerice()-scalars such as, e.g.,N,r2, orchi2, but also stringe()-macros such ascmdordepvar. In addition, the following statistics are available:aicAkaike's information criterionbicSchwarz's information criterionrankrank ofe(V), i.e. the number of free parameters in modelpthe p-value of the model (overall model significance) See[R] estimates tablefor details on theaicandbicstatistics. The rules for the determination ofpare as follows (note that although the procedure outlined below is appropriate for most models, there might be some models for which it is not): 1) p-value provided: If thee(p)scalar is provided by the estimation command, it will be interpreted as indicating the p-value of the model. 2) F test: Ife(p)is not provided,estoutchecks for the presence of thee(df_m),e(df_r), ande(F)scalars and, if they are present, the p-value of the model will be calculated asFtail(df_m,df_r,F). This p-value corresponds to the standard overall F test of linear regression. 3) chi2 test: Otherwise, if neithere(p)nore(F)is provided,estoutchecks for the presence ofe(df_m)ande(chi2)and, if they are present, calculates the p-value aschi2tail(df_m,chi2). This p-value corresponds to the Likelihood-Ratio or Wald chi2 test. 4) If neithere(p),e(F), nore(chi2)is available, no p-value will be reported. Typeereturn listafter estimating a model to see a list of the returnede()-scalars and macros (see helpereturn). Use theestaddcommand to add extra statistics and other information to thee()-returns. The followingstats_suboptsare available. Use:fmt(fmt[fmt...])to set the display formats for the scalars statistics inscalarlist.fmtmay be any of Stata's numerical display formats, e.g.,%9.0gor%8.2f, an integer#such as1or3to use a fixed format with#decimal places, ora#such asa1ora3to useestout's adaptive display format (see Numerical formats in the {help estout##rem:Remarks} section for details). For example,fmt(30)would be suitable forstats(r2_a N). Note that the last specified format is used for the remaining scalars if the list of scalars is longer than the list of formats. Thus, only one format needs to be specified if all scalars are to be displayed in the same format. If no format is specified, the default format is the display format of the coefficients.labels(strlist[,label_subopts])to specify labels for rows containing the scalar statistics. If specified, the labels are used instead of the scalar names. For example: . estout..., stats(r2_a N, labels("Adj. R-Square" "Number of Cases")) Note that names liker2_aproduce an error in LaTeX because the underscore character has a special meaning in LaTeX (to print the underscore in LaTeX, type\_). Use thelabel()suboption to rename such statistics, e.g.stats(r2_a,labels(r2\_a)). An alternative approach is to useestout'ssubstitute()option (see the Layout options).star[(scalarlist)] to specify that the overall significance of the model be denoted by stars. The stars are attached to the scalar statistics specified inscalarlist. Ifscalarlistis omitted, the stars are attached to the first reported scalar statistic. The printing of the stars is suppressed in empty results cells (i.e. if the scalar statistic in question is missing for a certain model). The determination of the model significance is based on the p-value of the model (see above). Hint: It is possible to attach the stars to different scalar statistics within the same table. For example, specifystats(,star(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 ther2_a; for the probit models, the chi2 test will be used and the stars will appear next to ther2_p.layout(array)to rearrange the summary statistics. The default is to print the statistics in separate rows beneath one another (in each model's first column). The syntax forarrayis <row> [ <row> ... ] whererowis <cell> [ <cell> ... ] and@is used as a placeholder for the statistics, one after another. Rows and cells that contain blanks have to be embraced in quotes. For example, ... stats(chi2 df_m N, layout("@ @" @)) prints for each model in row 1/column 1 the chi-squared, in row1/column 2 the degrees of freedom, and in row 2/column 1 the number of observations. Cells may contain multiple statistics and text other than the placeholder symbol is printed as is (provided the cells' statistics are part of the model). For example, ... stats(chi2 df_m N, layout(`""@ (@)""' @)) prints a cell containing "chi2 (df_m)" in the first row and the number of observations in the second row. Note that the number of columns in the table only depends on thecells()option (see above) and not on thelayout()suboption. If, for example, the table has two columns per model and you specify three columns of summary statistics, the summary statistics in the third column are not printed.pchar(symbol)to specify the placeholder symbol used inlayout(). The default placeholder is@. +--------------------+ ----+ Significance stars +-----------------------------------------------starlevels(levelslist)overrides the default thresholds and symbols for "significance stars". For instance,starlevels(+ 0.10 * 0.05)sets 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. To, for example, denote insignificant results, typestarlevels(* 1 "" 0.05).stardrop(droplist[, relax])identifies the coefficients for which the significance stars be suppressed.droplistis specified as indrop()(see above).starkeep(keeplist[, relax])selects the coefficients for which the significance stars, if requested, be printed.keeplistis specified analogous todroplistindrop()(see above).stardetachspecifies that a delimiter be placed between the statistics and the significance stars (i.e. that the stars are to be displayed in their own column). +--------+ ----+ Layout +-----------------------------------------------------------varwidth(#)specifies the number of characters used to display the names (labels) of regressors and statistics (i.e.varwidthspecifies the width of the table's left stub). Long names (labels) are abbreviated (depending on theabbrevoption) and short or empty cells are padded out with blanks to fit the width specified by the user.varwidthset to 0 means that the names are not abbreviated and no white space is added. Specifying low values may cause misalignment.modelwidth(#[#...])designates the number of characters used to display the results columns. If a non-zeromodelwidthis specified, model names are abbreviated if necessary (depending on theabbrevoption) and short or empty results cells are padded out with blanks. In contrast,modelwidthdoes not shorten or truncate the display of the results themselves (coefficients, t-statistics, summary statistics, etc.) although it may add blanks if needed.modelwidthset to 0 means that the model names are not abbreviated and no white space is added. Specifying low values may cause misalignment. Specify a list of numbers inmodelwidth()to assign individual widths to the different results columns (the list is recycled if there are more columns than numbers). The purpose ofmodelwidthis to be able to construct a fixed-format table and thus make the raw table more readable. Be aware, however, that the added blanks may cause problems with the conversion to a table in word processors or spreadsheets.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. Summary statistics will be reported for each equation ifunstackis specified and the estimation command is eitherreg3,sureg, ormvreg(see helpreg3, helpsureg, helpmvreg).begin(string)specifies a string to be printed at the beginning of every table row. It is possible to use special functions such as_tabor_skipinbegin(). For more information on using such functions, see the description of the functions in helpfile.delimiter(string)designates the delimiter used between the table columns. See thebeginoption above for further details.end(string)specifies a string to be printed at the end of every table row. See thebeginoption above for further details.incelldelimiter(string)specifies text to be printed between parameter statistics that have been combined in a single cell by the&operator. See thecells()option for details. The default string is a single blank.dmarker(string)specifies the form of the decimal marker. The standard decimal symbol (a period or a comma, depending on the input provided toset dp; see help format) is replaced bystring.msign(string)determines the form of the minus sign. The standard minus sign (-) is replaced bystring.lzspecifies that the leading zero of fixed format numbers in the interval (-1,1) be printed. This is the default. Usenolzto adviseestoutto omit the leading zeros (that is, to print numbers like0.021or-0.33as.021and-.33).extracols(numlist)inserts empty table columns at the indicated positions. For example,extracols(1)adds an extra column between the left stub of the table and the first column.substitute(subst_list)specifies that the substitutions specified insubst_listbe applied to the estimates table after it has been created. Specifysubst_listas a list of substitution pairs, that is:fromto[fromto...] For example, specifysubstitute(_ \_)to replace the underscore character (as in_consorF_p) with it's LaTeX equivalent\_. +----------+ ----+ Labeling +---------------------------------------------------------labelspecifies that variable labels be displayed instead of variable names in the left stub of the table.abbrevspecifies that long names and labels be abbreviated if amodelwidth()and/or avarwidth()is specified.wrapcauses long variable labels to be wrapped if space permits and avarwidth()is specified. Thewrapoption is only useful if several parameter statistics are printed beneath one another and, therefore, white space is available beneath the labels.interaction(string)specifies the string to be used as delimiter for interaction terms (only relevant in Stata 11 or newer). The default isinteraction(" # "). Forstyle(tex)the default isinteraction("$\times$ ").title(string)may be used to specify a title for the table. Thestringis printed at the top of the table unlessprehead(),posthead(),prefoot(), orpostfoot()is specified. In the latter case, the variable@titlecan be used to insert the title.note(string)may be used to specify a note for the table. Thestringis printed at the bottom, of the table unlessprehead(),posthead(),prefoot(), orpostfoot()is specified. In the latter case, the variable@notecan be used to insert the note.legendadds a legend explaining the significance symbols and thresholds.prehead(strlist),posthead(strlist),prefoot(strlist), andpostfoot(strlist)may be used to define lists of text lines to appear before and after the table heading or the table footer. For example, the specification . estout..., prehead("\S_DATE \S_TIME" "") would add a line containing the current date and time followed by an empty line before the table. Various substitution functions can be used as part of the text lines specified instrlist(see the Remarks on using @-variables). For example,@hlineplots a horizontal "line" (series of dashes, by default; see thehlinechar()option) or@Minserts the number of models in the table.@Mcould be used in a LaTeX table heading as follows: . estout..., prehead(\begin{tabular}{l*{@M}{r}})hlinechar(string)specifies the character(s) to be used in@hline. The default ishlinechar(-), resulting in a dashed line. To produce a solid line, specifyhlinechar(`=char(151)')(Windows only; other systems may use other codes).varlabels(matchlist[,suboptions])may be used to relabel the regressors from the models, wherematchlistisnamelabel[namelabel...] Anameis a parameter name (e.g.price) or a full name (e.g.mean:price) (abbreviation and wildcards not allowed). For example, specifyvarlabels(_cons Constant)to replace each occurrence of_conswithConstant. (Note that, in LaTeX, the underscore character produces an error unless it is specified as\_. Thus, names such as_consshould always be changed if the estimates table is to be used with LaTeX. Thesubstitute()may also be helpful; see the Layout options.) Thesuboptionsare:blist(matchlist)to assign specific prefixes to certain rows in the table body. Specify thematchlistas pairs of regressors and prefixes, that is:nameprefix[nameprefix...] Anameis a parameter name (e.g.price), an equation name followed by a colon (e.g.mean:), or a full name (e.g.mean:price) (abbreviation and wildcards not allowed). Note that equation names cannot be used if theunstackoption is specified.elist(matchlist)to assign specific suffixes to certain rows in the table body (see the analogousblist()option above). This option may, for example, be useful for separating thematic blocks of variables by adding vertical space at the end of each block. A LaTeX example: . estout..., varlabels(,elist(price \addlinespace mpg \addlinespace)) (the macro\addlinespaceis provided by thebooktabspackage in LaTeX)label_subopts, which are explained in their own section.labcol2(strlist[,suboptions])adds a second column containing additional labels for the coefficients and summary statistics. Labels containing spaces should be embraced in double quotes ("label 1""label 2"etc.). An example would be to add a column indicating the hypothesized directions of effects, e.g., . estout..., labcol2(+ - +/- + 0) Thesuboptionsare:title(strlist)to add text in the table header above the column. Use double quotes to break the title into several rows (given there are multiple header rows), i.e. specifystrlistas"line 1""line 2"etc.width(#)to set the width, in number of characters, of the column. The default is the value ofmodelwidth().refcat(matchlist[,suboptions])may be used to insert a row containing information on the reference category of a categorical variable in the model.matchlistisnamerefcat[namerefcat...] Anameis a parameter name (e.g._Irep78_2) (abbreviation and wildcards not allowed). For example, assume that you include the categorical variablerep78("Repair Record 1978" from the auto dataset) in some of your models usingxi(see helpxi). Sincerep78has five levels, 1 through 5,xiwill create 4 dummy variables,_Irep78_2through_Irep78_5. You can now type . estout..., refcat(_Irep78_2 _Irep78_1) to add a table row containing "_Irep78_1" in the left stub and "ref." in each column in which the_Irep78_2dummy appears. Thesuboptionsare:label(string)to specify the label that is printed in the table columns. The default islabel(ref.). Typenolabelto suppress the default label.belowto position the reference category row below the specified coefficient's row. The default is above. For example, if the 5th category ofrep78is used as reference category, i.e. if_Irep78_1through_Irep78_4are included in the models, you might want to typerefcat(_Irep78_4 _Irep78_5, below).mlabels(strlist[,suboptions])determines the model captions printed in the table heading. The default is to use the names of the stored estimation sets (or their titles, if thelabeloption is specified and titles are available). Thesuboptionsfor use withmlabelsare:depvarsto specify that the name (or label) of the (first) dependent variable of the model be used as model label.titlesto specify that, if available, the title of the stored estimation set be used as the model label. Note that thelabeloption impliestitles(unlessnotitlesis specified).depvarstakes precedence overtitles.numbersto cause the model labels to be numbered consecutively.label_subopts, which are explained in their own section.collabels(strlist[,label_subopts])specifies labels for the columns within models or equations. The default is to compose a label from the names or labels of the statistics printed in the cells of that column. Thelabel_suboptsare explained in their own section below.eqlabels(strlist[,suboptions])labels the equations. The default is to use the equation names as stored by the estimation command, or to use the variable labels if the equation names correspond to individual variables and thelabeloption is specified. Thesuboptionsfor use witheqlabelsare:mergeto merge equation labels and parameter labels instead of printing equation labels in separate rows. Equation and parameter labels will be separated by ":" unless another delimiter is specified via thesuffix()suboption (seelabel_subopts).mergehas no effect ifunstackis specified.label_subopts, which are explained in their own section. Note thateqlabels(none)causes_consto be replaced with the equation name or label, if_consis the only parameter in an equation. This is useful, e.g., for tabulatingologitoroprobitresults in Stata 9. Specifyeqlabels("", none)to not replace_cons.mgroups(strlist[,suboptions])may be used to labels groups of (consecutive) models at the top of the table heading. The labels are placed in the first physical column of the output for the group of models to which they apply. Thesuboptionsfor use withmgroupsare:pattern(pattern)to establish how the models are to be grouped.patternshould be a list of zeros and ones, with ones indicating the start of a new group of models. For example, . estout..., mgroups("Group 1" "Group 2", pattern(1 0 0 1 0)) would group Models 1, 2, and 3 together and then groups Models 4 and 5 together as well. Note that the first group will always start with the first model regardless of whether the first token ofpatternis a one or a zero.label_subopts, which are explained in their own section. In particular, thespansuboption might be of interest here.numbers[(lr)] adds a row to the table header displaying consecutive model numbers. The default is to enclose the numbers in parentheses, i.e.(1),(2), etc. Alternatively, specifylandrto change the tokens on the left and right of each number. For example,numbers(""")")would result in1),2), etc. +--------+ ----+ Output +-----------------------------------------------------------replacepermitsestoutto 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.typespecifies that the assembled estimates table be printed in the results window and the log file. This is the default unlessusingis specified. Usenotypeto suppress the display of the table.showtabsrequests that tabs be displayed as<T>s in both the results window and the log file instead of in expanded form. This option does not affect how tabs are written to the text file specified byusing.topfile(filename)andbottomfile(filename)may be used to insert text before and after the table, where the text is imported from a file on disk. Note thatsubstitute()does not apply to text inserted bytopfile()orbottomfile(). +----------+ ----+ Defaults +---------------------------------------------------------style(style)specifies a "style" for the output table.defaults(style)is a synonym forstyle(style). A "style" is a named combination of options that is saved in an auxiliary file calledestout_style.def. In addition, there are five internal styles calledsmcl(default for screen display),tab(export default),fixed,tex, andhtml. Thesmclstyle is suitable for displaying the table in Stata's results window and is the default unlessusingis specified. It includes SMCL formatting tags and horizontal lines to structure the table. The particulars of the other styles are: settings stylestabfixedtexhtml-----------------------------------------------begin<tr><td>delimiter_tab" "&</td><td>end\\</td></tr>varwidth012/20*12/20*12/20*modelwidth0121212abbrevoff on off off (* iflabelis on)tabis the default export style (i.e. ifusingis specified). Note that explicitly specified options take precedence over settings provided by a style. For example, if you type . estout, delimiter("") style(tab) then the column delimiter will be set to empty string since thedelimiter()option overwrites the default from thetabstyle. Similarly, specifyingnoabbrevwill turn abbreviation off if using thefixedstyle. See Defaults files in the Remarks section to make available your own style.+---------------+----+label_subopts+---------------------------------------------------- The following suboptions may be used within themgroups(),mlabels(),collabels(),eqlabels(),varlabels(), andstats(, labels())options:nonesuppresses the printing of the labels or drops the part of the table heading to which it applies. Note that instead of typingoption(, none)you may simply specifyoption(none).prefix(string)specifies a common prefix to be added to each label.suffix(string)specifies a common suffix to be added to each label.begin(strlist)specifies a prefix to be printed at the beginning of the part of the table to which it applies. Ifbeginis specified invarlabels()orstats(,labels()), the prefix will be repeated for each regressor or summary statistic.firstspecifies that the first occurrence of thebegin()-prefix invarlabels()orstats(,labels())be printed. This is the default. Usenofirstto suppress the first occurrence of the prefix. Invarlabels(),nofirstapplies equation-wise, i.e., the firstbegin()-prefix in each equation is suppressed (unlessunstackis specified).end(strlist)specifies a suffix to be printed at the end of the part of the table to which it applies. Ifendis specified invarlabels()orstats(,labels()), the suffix will be repeated for each regressor or summary statistic.lastspecifies that the last occurrence of theend()-suffix invarlabels()orstats(,labels())be printed. This is the default. Usenolastto suppress the last occurrence of the suffix. Invarlabels(),nolastapplies equation-wise, i.e., the lastend()-suffix in each equation is suppressed (unlessunstackis specified).replacecauses the label suboptionbegin()-prefix andend()-suffix to be used instead of the globalbegin()andend()strings. The default is to print both.replacealso applies toblist()andelist()if specified invarlabels().spancauses labels to span columns, i.e. extends the labels across several columns, if appropriate. This suboption is relevant only for themgroups(),mlabels(),eqlabels(), andcollabels()options. The@spanstring returns the number of spanned columns if it is included in the label, prefix, or suffix. A LaTeX example: . estout..., mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(}))erepeat(string)specifies a string that is repeated for each group of spanned columns at the very end of the row if thespansuboption is specified. This suboption is relevant only for themgroups(),mlabels(),eqlabels(), andcollabels()options. If the@spanstring is included instringit will be replaced by the range of columns spanned. A LaTeX example: . estout..., mlabels(, span erepeat(\cline{@span}))lhs(string)insertsstringinto the otherwise empty cell in the left stub of the row of the table heading to which it applies. This suboption is relevant only for themgroups(),mlabels(),eqlabels(), andcollabels()options.+----------------+----+matrix_subopts+--------------------------------------------------- The following suboptions may be applied within thematrix(),e(), orr()argument used to tabulate a matrix:fmt(fmtlist)sets the display formats for the matrix.fmtlistcontains a list of format specifications, one for each column of the matrix.fmtlistis recycled if it supplies less specifications than there are columns in the matrix. A format specification may be a singlefmtsuch as, e.g.,%9.0gora3(see Numerical formats in the Remarks section for details) to be applied to all cells in the column. Alternatively, a format specification may be a list offmts, enclosed in double quotes, to be used for the cells in the column one by one. The last format in the list is used for the remaining cells if the number of cells in the column is greater than the number of formats in the list. Also see the examples below.transposecauses the matrix to be transposed for tabulation.Contents Introduction Publication style table t-statistics for selected variables only Summary statistics only Table of descriptives Unstack multiple equations Tabulating a matrix Please first read the Introduction. The other examples are more advanced and intended for users already familiar with the basic features ofExamplesestout. Additional examples can be found in Jann (2005) and at http://repec.org/bocode/e/estout. +--------------+ ----+ Introduction +----------------------------------------------------- The full syntax ofestoutis rather complex and is to be found above. However, consider the following basic syntax, which includes only the most important options:estout[namelist] [usingfilename] [,cells(array)stats(scalarlist)style(style)more_options] wherenamelistis a list of the names of stored estimation sets (the name list can be entered as*to refer to all stored estimates). Thecells()andstats()options determine the primary contents of the table. Thestyle()option determines the basic formatting of the table.Basic usageThe general procedure for usingestoutis to first store several models using theestimates storeor theeststocommand and then applyestoutto display or save a table of the estimates. By default,estoutdisplays a plain table of the coefficients of the models and uses SMCL tags and horizontal lines to structure the table: . sysuse auto (1978 Automobile Data) . replace price = price / 1000 price wasintnowfloat(74 real changes made) . replace weight = weight / 1000 weight wasintnowfloat(74 real changes made) . quietly regress price weight mpg . estimates store m1, title(Model 1) . generate forXmpg = foreign * mpg . quietly regress price weight mpg forXmpg foreign . estimates store m2, title(Model 2) . estout m1 m2-------------------------------------- m1 m2 b b -------------------------------------- weight1.746559 4.613589mpg-.0495122 .2631875forXmpg-.3072165foreign11.24033_cons1.946068 -14.44958-------------------------------------- Alternatively, ifusingis specified,estoutwrites a raw tab-delimited table (without SMCL tags and without lines) to the indicated file (*is used in the following example to indicate that all stored models be tabulated): . estout * using example.txt (output written to example.txt) . type example.txtm1 m2b bweight 1.746559 4.613589mpg -.0495122 .2631875forXmpg -.3072165foreign 11.24033_cons 1.946068 -14.44958The table looks messy in the Stata results window or the Stata log because the columns are tab-separated (note that tab characters are not preserved in the results window or the log). However, the table would look tidy if "example.txt" were opened, for example, in a spreadsheet program.Choosing a styleestouthas astyle()option to set the basic format of the table. The default style for screen display is thesmclstyle. The default export style (i.e. ifusingis specified) is thetabstyle. (See the examples above.) Other predefined styles arefixed,tex, andhtml, but it is also possible to define one's own styles (see Defaults files in the Remarks section). Thetexstyle, for example, modifies the output table for use with LaTeX's tabular environment: . estout *, style(tex) varlabels(_cons \_cons)& m1& m2\\& b& b\\weight & 1.746559& 4.613589\\mpg & -.0495122& .2631875\\forXmpg & & -.3072165\\foreign & & 11.24033\\\_cons & 1.946068& -14.44958\\Note that_conshas been replaced by its LaTeX equivalent in the example above using thevarlabels()option (the underscore character produces an error in LaTeX unless it is preceded by a backslash). For more information on thevarlabels()option, seeestout's Labeling options.The cells optionUse thecells()option to specify the parameter statistics to be tabulated and how they are to be arranged. The parameter statistics available areb(point estimates; the default),se(standard errors),t(t-/z-statistics),p(p-values),ci(confidence intervals; to display the lower and upper bounds in separate cells useci_landci_u), as well as any additional parameter statistics included in thee()-returns for the models (seeestout's Parameter Statistics options). For example,cells(bse)results in the reporting of point estimates and standard errors: . estout *, cells(b se)-------------------------------------- m1 m2 b/se b/se -------------------------------------- weight1.746559 4.613589.6413538 .7254961mpg-.0495122 .2631875.086156 .1107961forXmpg-.3072165.1085307foreign11.240332.751681_cons1.946068 -14.449583.59705 4.42572-------------------------------------- Multiple statistics are placed in separate rows beneath one another by default as in the example above. However, elements that are listed in quotes or in parentheses are placed beside one another. For example, specifyingcells("b se t p")or, equivalently,cells((b se t p))produces the following table: . estout m2, cells("b se t p")---------------------------------------------------------------- m2 b se t p ---------------------------------------------------------------- weight4.613589 .7254961 6.359219 1.89e-08mpg.2631875 .1107961 2.375421 .0203122forXmpg-.3072165 .1085307 -2.830687 .0060799foreign11.24033 2.751681 4.084896 .0001171_cons-14.44958 4.42572 -3.26491 .0017061---------------------------------------------------------------- The two approaches can be combined. For example,cells("b p" se)would produce a table with point estimates and standard errors beneath one another in the first column and p-values in the top row of the second column for each model. Note that for each statistic named in thecells()option a set of suboptions may be specified in parentheses. For example, in social sciences it is common to report standard errors or t-statistics in parentheses beneath the coefficients and to indicate the significance of individual coefficients with stars. Furthermore, the results are rounded. Just such a table can be created using the following procedure: . estout *, cells(b(star fmt(3)) t(par fmt(2)))-------------------------------------------- m1 m2 b/t b/t -------------------------------------------- weight1.747** 4.614***(2.72) (6.36)mpg-0.050 0.263*(-0.57) (2.38)forXmpg-0.307**(-2.83)foreign11.240***(4.08)_cons1.946 -14.450**(0.54) (-3.26)-------------------------------------------- Theestoutdefault is to display*for p<.05,**for p<.01, and***for p<.001. However, note that the significance thresholds and symbols are fully customizable (seeestout's Significance stars options).The stats optionFinally, use thestats()option to specify scalar statistics to be displayed for each model in the table footer. The available scalar statistics areaic(Akaike's information criterion),bic(Schwarz's information criterion),rank(the rank ofe(V), i.e. the number of free parameters in model),p(the p-value of the model), as well as any numeric or string scalars contained in thee()-returns for the models (seeestout's Summary statistics options). For example, specifystats(r2bic N)to add the R-squared, BIC, and the number of cases: . estout *, stats(r2 bic N)-------------------------------------- m1 m2 b b -------------------------------------- weight1.746559 4.613589mpg-.0495122 .2631875forXmpg-.3072165foreign11.24033_cons1.946068 -14.44958-------------------------------------- r2.2933891 .5516277bic356.2918 331.2406N74 74-------------------------------------- +-------------------------+ ----+ Publication style table +------------------------------------------ . label variable foreign "Foreign car type" . label variable forXmpg "Foreign*Mileage" . estout *, cells(b(star fmt(%9.3f)) se(par)) /// > stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) /// > legend label collabels(none) varlabels(_cons Constant)---------------------------------------------------- Model 1 Model 2 ---------------------------------------------------- Weight (lbs.)1.747** 4.614***(0.641) (0.725)Mileage (mpg)-0.050 0.263*(0.086) (0.111)Foreign*Mileage-0.307**(0.109)Foreign car type11.240***(2.752)Constant1.946 -14.450**(3.597) (4.426)---------------------------------------------------- R-squared0.273 0.526N74 74---------------------------------------------------- * p<0.05, ** p<0.01, *** p<0.001 +------------------------------------------+ ----+ t-statistics for selected variables only +------------------------- . estout *, cells(b(star) t(par keep(mpg)))-------------------------------------------- m1 m2 b/t b/t -------------------------------------------- weight1.746559** 4.613589***mpg-.0495122 .2631875*(-.5746806) (2.375421)forXmpg-.3072165**foreign11.24033***_cons1.946068 -14.44958**-------------------------------------------- +-------------------------+ ----+ Summary statistics only +------------------------------------------ . estout *, cells(none) stats(r2_a bic N, star)-------------------------------------------- m1 m2 -------------------------------------------- r2_a.2734846*** .5256351***bic356.2918 331.2406N74 74-------------------------------------------- +-----------------------+ ----+ Table of descriptives +-------------------------------------------- . quietly generate x = uniform() . quietly regress x price weight mpg foreign . estadd mean added matrix: e(mean) :1 x 5. estadd sd, nobinary added matrix: e(sd) :1 x 5. estout, cells("mean sd") stats(N) mlabels(,none) drop(_cons)-------------------------------------- mean sd -------------------------------------- price6.165257 2.949496weight3.019459 .7771936mpg21.2973 5.785503foreign.2972973-------------------------------------- N74-------------------------------------- +----------------------------+ ----+ Unstack multiple equations +--------------------------------------- . quietly sureg (price foreign weight length) /// > (mpg displ = foreign weight) . estout, cells(b t(par)) stats(r2 chi2 p) unstack--------------------------------------------------- price mpg displacement b/t b/t b/t --------------------------------------------------- foreign3.57526 -1.650029 -25.6127(5.749891) (-1.565555) (-2.047999)weight5.691462 -6.587886 96.75485(6.182983) (-10.55641) (13.06594)length-.0882711(-2.809689)_cons4.506212 41.6797 -87.23547(1.255897) (19.64914) (-3.46585)--------------------------------------------------- r2.548808 .6627029 .8115213chi289.73586 145.3912 318.6174p2.50e-19 2.68e-32 6.50e-70--------------------------------------------------- +---------------------+ ----+ Tabulating a matrix +---------------------------------------------- Useestout matrix(matname)to tabulate Stata matrixmatname. Example: . set seed 123 . matrix A = matuniform(3,2) . matrix list A A[3,2] c1 c2 r1.91204397 .0075452r2.28085881 .46027868r3.56010592 .67319061. estout matrix(A)-------------------------------------- A c1 c2 -------------------------------------- r1.912044 .0075452r2.2808588 .4602787r3.5601059 .6731906-------------------------------------- Numeric formats for the columns can be set using thefmt()suboption: . estout matrix(A, fmt(2 3))-------------------------------------- A c1 c2 -------------------------------------- r10.91 0.008r20.28 0.460r30.56 0.673-------------------------------------- A list of formats can be specified for each column: . estout matrix(A, fmt("2 3 4" "4 3 2"))-------------------------------------- A c1 c2 -------------------------------------- r10.91 0.0075r20.281 0.460r30.5601 0.67--------------------------------------Contents Numerical formats Special characters Using @-variables Defaults files +-------------------+ ----+ Numerical formats +------------------------------------------------ Numerical display formats may be specified inRemarksestoutas 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,cells(t(fmt(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. +--------------------+ ----+ Special characters +----------------------------------------------- The\and$characters and quotation marks have special meanings in Stata. You should therefore consider the following instructions if you, for example, intend to specify akward delimiters or specify special characters in labels: - Strings containing unmatched quotes should be enclosed in compound double quotes (thus,delimiter(`"""')results in columns delimited by", whiledelimiter(")produces an error). - The backslash character is used to delay macro expansion in Stata. Specifying\\in Stata 8 just results in the printing of\. To get a double backslash in Stata 8 (the\newlinecommand in TeX), type\\\. - The dollar sign is used for global macro expansion in Stata. Thus,$xwould result in the display of the contents of global macrox(or nothing, if the macro is empty). Therefore, use\$to produce$in the output. For math mode in LaTeX I recommend using\(...\)instead of$...$. Stata'schar()function may also be used to specify odd characters (see help strfun). In particular,"`=char(9)'"results in a tab character and"`=char(13)'"results in a carriage return. For example,delimiter(" `=char(9)' ")specifies that a tab character with a leading and a trailing blank be used as delimiter.Tip:It is sometimes very useful to set the format of all cells in a spreadsheet to "Text" before pasting the estimates table. This prevents the spreadsheet program from trying to interpret the cells and ensures that the contents of the table remain unchanged. +-------------------+ ----+ Using @-variables +------------------------------------------------estoutfeatures several variables that can be used within string specifications. The following list provides an overview of these variables. o Inprehead(),posthead(),prefoot(), andpostfoot(), in thebegin()andend()label suboptions, and in theblist()andelist()suboptions invarlabels():@spanto return the value of a count variable for the total number of physical columns of the table.@Mto return the number of models in the table.@Eto return the total number columns containing separate equations.@widthto return the total width of the table (number of characters).@hlineto return a horizontal line (series of dashes, by default; see thehlinechar()option). o Inprehead(),posthead(),prefoot(), andpostfoot():@titleto return the title specified with thetitle()option.@noteto return the note specified with thenote()option.@discreteto return the explanations provided by thediscrete()option (provided that themarginoption is activated).@starlegendto return a legend explaining the significance symbols. o In theprefix()andsuffix()suboptions ofmgroups(),mlabels(),eqlabels(), andcollabels(), and in the labels specified in these options:@spanto return the number of spanned columns. o In theerepeat()suboption ofmgroups(),mlabels(),eqlabels(), andcollabels():@spanto return the range of spanned columns (e.g.2-4if columns 2, 3 and 4 are spanned). +----------------+ ----+ Defaults files +---------------------------------------------------Creating new defaults files:To make available an own set of default options, proceed as follows: 1. Download "estout_mystyle.def" from the SSC Archive (click here to copy the file from SSC and store it in the working directory). 2. Open "estout_mystyle.def" in a text editor and make the desired modifications (click here to open "estout_mystyle.def" in Stata's Do-File Editor). 3. Save the file in the current directory or elsewhere in the ado-file path asestout_newstyle.def(see help sysdir). To use the new options set inestout, then type: . estout..., style(newstyle)Defaults files syntax:estouthas two main types of options, which are treated differentially in defaults files. On the one hand, there are simple on/off options without arguments, likelegendorshowtabs. To turn such an option on, enter the option followed by the options name as an argument, i.e. add the lineoptionoptionto the defaults file. For example, legend legend specifies that a legend be printed in the table footer. Otherwise, if you want to turn the option of, just delete or comment out the line that contains it (or specifyoptionwithout an argument). To temporarily turn off an option that has been activated in a defaults file, specifynooptionin the command line (do not, however, usenooptionin defaults files). For example, if the legend has been turned on in the defaults file, but you want to suppress it in a specific call ofestout, type . estout..., nolegend On the other hand, there are options that take arguments, such asprehead(args),delimiter(args), orstats(args,...). Such options are specified asoptionargsin the defaults file (whereargsmust not include suboptions; see below). Specifying an option in the command line overwrites the settings from the defaults file. However, note that anoform, which exists for the first options type, is not available here. Last but not least, there are two options that reflect a combination of the first and second types:eform[(args)] andmargin[(args)]. These options can be specified as eitheroptionoptionoroptionargsin the defaults file; thenoform is allowed. Manyestoutoptions have suboptions, i.e., an option might take the formoption(...,suboption)oroption(...,suboption(args)). In the defaults file, the suboptions cannot be included in the definition of a higher-level option. Instead, they must be specified in their own lines, as eitheroptionsuboptionsuboptionoroptionsuboptionargsIn the case of a two-level nesting of options, the name used to refer to the suboption is a concatenation of the option's name and the suboption's name, i.e."optionsuboption"="option"+"suboption". For example, thelabels()suboption of thestats()option would be set by the termstatslabels. Analogously, the three level nesting in thestats()option yields suboption names composed of three names. For instance, the suboption called by the command . estout..., stats(..., labels(..., prefix(args))) would be referred to as statslabelsprefixargsin the defaults file. Thecells()option represents an exception to this rule. It may be defined in the defaults file using only a plain array of cells elements without suboptions, e.g. cells "b se" p However, the suboptions of the cells elements may be referred to asel_suboption, for example b_star star or se_par [ ]Comments in defaults files:Be aware that the support for comments in defaults files is limited. In particular, the/*and*/comment indicators cannot be used. The other comment indicators work (more or less) as usual, that is: o Empty lines and lines beginning with*(with or without preceding blanks) will be ignored. o//preceded by one or more blanks indicates that the rest of the line should be ignored. Lines beginning with//(with or without preceding blanks) will be ignored. o///preceded by one or more blanks indicates that the rest of the line should be ignored and the part of the line preceding it should be added to the next line. In other words,///can be used to split commands into two or more lines of code.Saved resultsestoutsaves the following inr(): Scalarsr(nmodels)number of modelsr(ccols)number of columns per model inr(coefs)Macrosr(cmdline)command as typedr(names)names of modelsr(m#_name)model-specific macros where#is the model number andnameis macro name Matricesr(coefs)coefficientsr(stats)summary statisticsCong, R. (2000). sg144: Marginal effects of the tobit model.ReferencesStataTechnical Bulletin56: 27-34. Jann, B. (2005). Making regression tables from stored estimates.TheStata Journal5(3): 288-308. Jann, B. (2007). Making regression tables simplified.The Stata Journal7(2): 227-244. Newson, R. (2003). Confidence intervals and p-values for delivery to the end user.The Stata Journal3(3): 245-269.I would like to thank numerous people for their comments and suggestions. Among them are Joao Pedro Azevedo, Kit Baum, Elisabeth Coutts, Henriette Engelhardt, Jonathan Gardnerand, Simone Hirschvogl, Daniel Hoechle, Friedrich Huebler, Maren Kandulla, J. Scott Long, David Newhouse, Clive Nicholas, Fredrik Wallenberg, Ian Watson, and Vince Wiggins.AcknowledgementsBen Jann, Institute of Sociology, University of Bern, jann@soz.unibe.chAuthorManual:Also see[R] estimatesSJ: SJ5-3 st0085 (Jann 2005) SJ7-2 st0085_1 (Jann 2007) Online: help forestimates, estcom,estimates table,ereturn, format,file,mfx,eststo,esttab,estadd,estpost