est2tex for Stata
current version: Mar 19, 2005
(contact Marc-Andreas Muendler)

The package est2tex creates LaTeX tables from Stata estimation results. The tables can be edited in Stata and loaded directly into LaTeX with the command \input{table.tex}.

To download the according .ado files, you can use the command
in Stata.
Alternatively, you can download the zip file.

### Commands

est2vec table [, replace vars(list_of_regressors) shvars(varlist) e(list_of_macro_names) r(list_of_macro_names) addto(oldtable) raddto(oldtable) name(estimation_name) force nokeep ]

est2tex table [, replace dropall preserve path(pathname) multse(list_of_integers) mark(marking_option) levels(three_levels) marktbl precision(real_number) digits(integer_number) flexible(integer_number) fancy horizontal cut label collabels(list_of_column_names) extracols(list_of_column_numbers) dots suppress plain(separator_type) ready leadzero thousep ]

est2rowlbl varlist [, replace dropall saving addto(table) path(pathname) ]

est2one table [, multse(list_of_integers) horizontal cut ]

### Description

The package est2tex creates a LaTeX table from estimation results in two stages. The package allows editing within Stata and creates an output file table.tex that can be read into any LaTeX document with \input{table.tex}.

First, the command est2vec collects estimation results. For this purpose, est2vec uses auxiliary matrices: table_b, table_se and table_e (and possibly table_r). In applying est2vec after each estimation command, estimation results can be added to the table in a step-by-step manner.

Second, the command est2tex transforms the so-created matrices into a LaTeX table and saves the result to disk. The output file table.tex can be read directly into a LaTeX document with the TeX command \input{table.tex}. Under the option plain(), est2tex saves the same information in a plain ascii file that can be included in any type-setting software.

The command est2rowlbl can be used prior to est2tex to save a file table_rowlbl.dta with variable labels. Then est2tex reports the variable labels in the rows of the LaTeX table, rather than variable names.

The command est2one creates a master matrix table_tbl from the auxiliary matrices table_b, table_se and table_e (and possibly table_r).

A simple example below explains the main steps.

The package matsave must be installed for est2tex to work.

### Options for est2vec

replace permits est2vec to overwrite the matrices table_b, table_se, table_e and table_r in memory. replace may not be abbreviated.

vars(list_of_regressors) Option vars(list_of_regressors) specifies that list_of_regressors be included in the auxiliary matrices table_b (coefficients) and table_se (according standard errors). If list_of_regressors contains variables (equations) that have not been regressors in the estimation, the according entries are set to -999 (missing for Stata versions prior to 8) in table_b and table_se. They will result in blanks (or dots under the option dots) in the final LaTeX table. If _cons is not in list_of_regressors, table_b and table_se will not include an estimate for the constant. In multiple equation regressions (commands such as reg3 or mlogit), option vars(list_of_regressors) recognizes regressors with colons (equation_name:variable). If vars(list_of_regressors) is not specified, est2vec includes all regressors from the most recent estimation in table_b and table_se.

shvars(varlist) can be a short-hand alternative to option vars(). shvars(varlist) specifies that varlist be included in table_b and table_se. Wildcards and dashes may be used in varlist. However, variables that are not in the current data will be ignored. Moreover, shvars(varlist) does not allow for regressors in multiple equation regressions (commands such as reg3 or mlogit); for those cases option vars() must be used. The estimate for the constant is always reported (_cons cannot be in varlist). If varlist contains variables that have not been regressors in the estimation, the according entries are set to -999 (missing for Stata versions prior to 8) in table_b and table_se. They will result in blanks (or dots under the option dots) in the final LaTeX table. Option vars() overrides shvars(varlist).

e(list_of_macro_names) specifies which e() macros beyond e(N) are included in table_e. If list_of_macro_names contains macros that have not been assigned during the estimation or if it refers to non-scalars, the according entries are set to -999 (missing for Stata versions prior to 8) in table_e. They will result in blanks (or dots under the option dots) in the final LaTeX table. Information in table_e will be reported below the coefficient estimates in the final LaTeX table.

r(list_of_macro_names) If this option is specified, est2vec exclusively assembles r() macros related to the estimation, such as test results. For this purpose, est2vec creates the auxiliary matrix table_r. If list_of_macro_names contains names that have not been assigned to r() macros, the according entries are set to -999 (missing for Stata versions prior to 8) in table_r. They will result in blanks (or dots under the option dots) in the final LaTeX table. Information in table_r will be reported below the e() entries in the final LaTeX table.

addto(oldtable) augments the matrices oldtable_b, oldtable_se and oldtable_e by a column that contains the results of the latest estimation. The matrices oldtable_b, oldtable_se and oldtable_e must have been created previously with est2vec. If the latest estimation contains coefficients that are not part of oldtable, those estimates will not be added. See option vars().

raddto(oldtable) augments the matrix oldtable_r by a column that contains the current values of the according r() macros. The matrix oldtable_r must have been created previously with est2vec. The procedure only applies to r() macros that are part of oldtable_r.

name(estimation_name) names the newly added column in table to estimation_name. By default, the column name of a newly added column is the dependent variable in the latest estimation. However, for the command est2tex to work, column names must be unique. The option name(estimation_name) helps avoid duplicate column names. Note that column names must satisfy the requirements for Stata variable names (column names must not start with a number, for instance, and should not exceed eight characters in length). When invoking the command est2tex later, the option collabels() will allow you to change the column names in the final table.

force can only be specified together with addto() or raddto(). Under the options addto(oldtable) or raddto(oldtable), est2vec adds estimates to oldtable only for those coefficients that are part of oldtable. Estimates for additional coefficients (macros) are ignored. The option force forces est2vec to add coefficient estimates (macros) to oldtable row by row, irrespective of whether they match or not. The added column must be conformable to the existing matrices oldtable_b, oldtable_se and oldtable_e (or oldtable_r if specified).

nokeep can only be specified together with addto(oldtable) or raddto(oldtable). The newly created vectors table_b, table_se and table_e (or table_r if specified) are dropped once the columns have been added to oldtable.

### Options for est2tex

replace permits est2tex to overwrite the output files table.tex and table_tbl.dta if they exist. Unless the option ready is specified, replace also overwrites an existing matrix table_tbl in memory. replace may not be abbreviated.

dropall drops all variables from memory to execute est2tex. If there are data in memory and neither dropall nor preserve is specified, est2tex will result in the error "no; data in memory would be lost".

path(pathname) supplies the path where est2tex saves table.tex and table_tbl.dta. pathname needs to be a valid string. If path() is not specified, then est2tex saves in the current Stata working directory.

multse(list_of_integers) includes a number of different standard errors below every coefficient estimate in the LaTeX table. For this purpose, according auxiliary matrices must be created first and named table_se1, table_se2, ... . The option multse(1 3 2), for instance, inserts standard errors from matrices table_se1, table_se3 and table_se2 in that order in the LaTeX table. When multse() is specified, then the option mark() must be followed by the number of the standard error table on which the marking should be based. Example: mark(it 2). multse() expects matrices between se1 and se9.

mark(marking_option) marks estimates according to their significance. When mark(stars) is specified, est2tex adds stars to the standard errors. Up to three levels of stars can be assigned with the levels() option (see below). When mark(starb) is specified, est2tex adds stars to the coefficient estimates. When mark(it) is specified, then est2tex sets a coefficient estimate in italics if it fails to be significant at the standard significance level (global macro S_level, see levels() option below). Estimators are assumed to be normally distributed.

levels(three_levels) changes significance levels for the mark() option. Default levels are based on the global Stata macro S_level. With S_level taking the standard value of 95, the default three_levels are "95 99 99.9" (for S_level 90, they are "90 95 99"; for 99 they are "99 99.9 99.99"). The default setting "95 99 99.9" has the following consequences. When mark(it) is specified, estimates are set in italics below the 95% significance level. When mark(stars) or mark(starb) is specified, estimates receive one star if they are significant at the 95% significance level, two stars at the 99% significance level and three stars at the 99.9% level. With levels(95 99 99) specified, no estimate would receive three stars. With levels(95 95 95), estimates would only receive one or no star. With levels(90 95 95), the mark(it) option results in italics below the 90% level and the mark(stars) or mark(starb) option in one star at the 90% level or above and in two stars at the 95% level or above. In general, the mark(it) option obeys the lowest of the three_levels. The mark(stars) or mark(starb) option obeys all three_levels as long as a level strictly exceeds the preceding level. Estimators are assumed to be normally distributed.

marktbl keeps an auxiliary matrix t_stars in memory. This matrix contains the information on significant and insignificant estimates.

precision(real_number). est2tex rounds figures in the LaTeX table so that they resemble the real number specified in precision(real_number). The option precision(.001), for instance, rounds all figures to three digits. precision() cannot be specified if digits() is used. precision(.001) and digits(3) are equivalent. The default for precision() is .001.

digits(integer_number). est2tex rounds figures in the LaTeX table to the number of digits specified in digits(). digits() cannot be specified if precision() is used. digits(3) and precision(.001) are equivalent. The default for digits() is 3.

flexible(integer_number) permits that figures exceed the number of specified digits. It only applies to figures that would otherwise be reported as zero. Under the option flexible(2), for instance, the figure .00005 is reported as such even though rounding under the default option digits(3) would create a zero. The default for flexible() is 2.

fancy results in a LaTeX table with additional features such as horizontal lines like in journal publications and additional intercolumn spacing to fill a predefined table width. This option is recommended if the table is to be embedded in a \begin{table} \end{table} environment in LaTeX. Otherwise, overfull or underfull boxes may result in LaTeX.

horizontal transposes the final table. The estimation results are reported in rows and the coefficient estimates are listed in columns. The option cut is automatically activated when horizontal is chosen.

cut suppresses both the e() and r() macro output in the final table.

label writes variable labels instead of variable names into the final table table.tex. If a variable is no longer in memory or if no label is set, the simple name is used. label is ignored under the options horizontal and ready. If the option fancy is simultaneously specified, common estimation or result macros such as e(N) or r(F) are reported with their according long names. If a row label file with the name table_rowlbl.dta exists in path(pathname), then the saved labels override the label option. See the command est2rowlbl below.

collabels(list_of_column_names) allows to rename the column names in the final table table.tex. Blanks must separate the column names in list_of_column_names from each other. The LaTeX symbol ~ can be used to obtain spacing within an individual column name. collabels() is ignored under the options horizontal and plain.

extracols(list_of_column_numbers) adds empty columns to a LaTeX table. The option extracols(1 3 5), for instance, adds empty columns to the LaTeX table behind columns 1, 3 and 5.

dots reports a dot instead of a blank for missing values.

suppress removes the standard errors from the LaTeX table. suppress may not be abbreviated.

plain(separator_type) produces an ascii file instead of a LaTeX table. plain(tab) saves a tabulator separated file table.txt, and plain(csv) a comma separated file table.csv. Some options producing specific LaTeX code are not active when plain is chosen.

ready produces a LaTeX table from an existing matrix table_tbl in Stata memory. The matrix table_tbl can be created using est2one (see below). When applying ready, the option horizontal should be used only once either with est2one or with est2tex. ready may not be abbreviated. When the mark() option is specified together with ready, est2tex expects coefficient estimates and standard errors to alternate row by row in the ready matrix table_tbl.

leadzero adds leading zeros to coefficient estimates, standard errors, and e() and r() numbers in the LaTeX table. The option leadzero requires the option fancy.

thousep inserts commas for thousands into coefficient estimates and standard errors in the LaTeX table. The option thousep requires the option fancy.

### Options for est2rowlbl

replace permits est2rowlbl to overwrite an existing row label file table_rowlbl.dta in path(pathname). replace may not be abbreviated.

dropall permits est2rowlbl to drop all variables from memory to save the file table_rowlbl.dta. If neither dropall nor saving is specified, est2rowlbl will result in the error "no; data in memory would be lost".

saving forces est2rowlbl to save the data that are presently in memory and to restore the data upon completion. Setting saving does not affect a preceding preserve command. If neither dropall nor saving is specified, est2rowlbl will result in the error "no; data in memory would be lost".

addto(table) specifies the table for which row labels are to be saved. The row label file receives the name table_rowlbl.dta in path(pathname).

path(pathname) supplies the path where est2rowlbl saves table_rowlbl.dta. pathname needs to be a valid string. If path() is not specified, then est2rowlbl saves in the current Stata working directory.

### Options for est2one

multse(list_of_integers) includes a number of different standard errors below every coefficient estimate in the final matrix table_tbl. For this purpose, according auxiliary matrices must be created first and named table_se1, table_se2, ... . The option multse(1 3 2), for instance, inserts standard errors from matrices table_se1, table_se3 and table_se2 in that order in table_tbl. multse() expects matrices between se1 and se9.

horizontal transposes the final table table_tbl. The estimation results are reported in rows and the coefficient estimates are listed in columns. The option cut is automatically activated when horizontal is chosen. If horizontal is specified with est2one, it should not be specified with est2tex under the option ready.

cut suppresses both the e() and r() macro output in the final table table_tbl.

### Example

We want to create a LaTeX table with regression results from ordinary least squares as in the Stata handbook (see regress). We have data on the mileage rating and weight of 74 automobiles. We wish to estimate mileage as a linear function of weight, squared weight and an indicator variable for foreign brands.

. generate weightsq = weight^2
. regress mpg weight weightsq foreign
(output suppressed)

We can collect information from this first regression with

. est2vec table, e(r2 F) vars(weight weightsq length domestic foreign _cons)

This command creates three auxiliary matrices table_b, table_se and table_e.

. matrix dir

______________table_e[3,1]
_____________table_se[6,1]
______________table_b[6,1]

Take a look at table_b, for instance.

. matrix list table_b

________table_b[6,1]
_________________________mpg
__________weight__-.01657294
________weightsq___1.591e-06
__________length________-999
________domestic________-999
_________foreign__-2.2035002
____________cons___56.538839

The auxiliary matrix table_e stores additional regression information from saved result macros:

. matrix list table_e

________table_e[3,1]
_____________________mpg
_________e(N)_________74
________e(r2)__.69129599
_________e(F)__52.251474

The command est2vec always stores the number of observations N in table_e. It takes this information from the saved result macro e(N). The option e(r2 F) adds R-squared and the F statistic from the macros e(r2) and e(F).

Since the variables length and domestic were not included in the regression, their coefficient estimates are reported as missing in table_b with the entry -999. The option vars(weight weightsq length domestic foreign _cons) has made sure that est2vec includes the variables length and domestic, beyond those in the regression. (The option vars() can also be used to exclude variables that are not to be reported.) If vars() is not specified, est2vec chooses all variables from the most recent regression.

No wildcards or dashes may be used in option vars(). In certain cases, the option shvars() can be a short-hand alternative to vars(). Here, we could have specified shvars(weight* length foreign). The constant _cons would be included automatically. However, shvars() only works for existing variables. So, shvars(weight* length domestic foreign) would result in an error message until we generate the variable domestic.

An additional regression (also in the Stata handbook) includes the variables length and domestic.

. gen byte domestic=~foreign
. reg weight length domestic, hascons
(output suppressed)

We can collect information from this regression with

. est2vec table, addto(table)

Under the option addto(), est2vec adds results from the present regression to the previously collected matrices. Check:

. matrix list table_b

________table_b[6,2]
_________________________mpg______weight
__________weight__-.01657294________-999
________weightsq___1.591e-06________-999
__________length________-999___31.444552
________domestic________-999____133.6775
_________foreign__-2.2035002________-999
____________cons___56.538839__-2983.9272

Stata sets missing values to zero in its result macros. Therefore, the estimate on _cons is zero under the hascons option and so is the standard error. Later, est2tex will produce a LaTeX table that sets both coefficients with -999 estimates and coefficients with zero standard errors to missing.

To create a LaTeX table from the assembled matrices, the command est2tex produces an auxiliary dataset in memory and then outputs the information to the file table.tex. So, the command est2tex needs an empty memory. If the present data are not removed from memory before, est2tex results in the error message "no; data in memory would be lost." Before applying est2tex, we could manually remove the current data from memory with the command drop _all. Alternatively, we can specify the option dropall to drop all variables from memory when est2tex is invoked.

We can also use the option preserve to preserve the present dataset in memory (Mark Holmes contributed the code for this option). est2tex still drops all variables. However, the data are automatically restored once est2tex has done its job (or after it encounters an error).

The command

. est2tex table, preserve path(../texdocs) mark(stars) fancy

creates a LaTeX table. It saves the files table.tex and table_tbl.dta in the directory "../texdocs/". If the Stata working directory is "c:\data\", for instance, the files will be saved in "c:\texdocs\". Upon completion, the data in memory is restored.

The option mark(stars) adds one star (two stars, three stars) to the standard error when a coefficient estimate is significant at the 95% (99%, 99.9%) level. The option fancy creates separating lines and adds spaces between columns to fit the predetermined table width in LaTeX.

Suppose we did not specify the option preserve with {cmd:est2tex}. Then a glance at the resulting dataset in memory shows what information goes into the LaTeX table.

. preserve
. est2tex table, replace dropall path(../texdocs) mark(stars) fancy
. list

_______________rowname________mpg_____weight
__________1.____weight__-.0165729_______-999
__________2.________se___.0039692_______-999
__________3.__weightsq___1.59e-06_______-999
__________4.________se___6.25e-07_______-999
__________5.____length_______-999___31.44455
__________6.________se_______-999___1.601234
__________7.__domestic_______-999___133.6775
__________8.________se_______-999___77.47614
__________9.___foreign____-2.2035_______-999
_________10.________se___1.059246_______-999
_________11.______cons___56.53884__-2983.927
_________12.________se___6.197383___275.1041
_________13.______e(N)_________74_________74
_________14._____e(r2)____.691296___.8991605
_________15.______e(F)___52.25147___316.5447

The resulting LaTeX code in file table.tex is somewhat less transparent.

__\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcc}
__ & \multicolumn{1}{c}{mpg} & \multicolumn{1}{c}{weight} \\
__\cline{2-3}
__ & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\
__\hline
__weight & -.016 & \\
__& \raisebox{.7ex}[0pt]{\scriptsize (.004)$^{***}$} & \\
__weightsq & 1.59e-06 & \\
__& \raisebox{.7ex}[0pt]{\scriptsize (6.25e-07)$^{*}$} & \\
__length & & 31.445 \\
__& & \raisebox{.7ex}[0pt]{\scriptsize (1.601)$^{***}$} \\
__domestic & & 133.678 \\
__& & \raisebox{.7ex}[0pt]{\scriptsize (77.476)} \\
__foreign & -2.203 & \\
__& \raisebox{.7ex}[0pt]{\scriptsize (1.059)$^{*}$} & \\
__cons & 56.539 & -2983.926 \\
__& \raisebox{.7ex}[0pt]{\scriptsize (6.197)$^{***}$} &
__ \raisebox{.7ex}[0pt]{\scriptsize (275.104)$^{***}$} \\
__e(N) & 74 & 74 \\
__e(r2) & .691 & .899 \\
__e(F) & 52.251 & 316.545 \\
__\hline\hline
__\end{tabular*}%

The resulting LaTeX document, however, should be quite agreeable. The file table.tex can be inserted into any LaTeX document with the command sequence \begin{table} \input{table.tex} \end{table}.

The following LaTeX code produces a sample document.

__\documentclass[12pt]{article}
__\begin{document}
__\title{Stata: \emph{est2tex}}%
__\author{\Large Help File Example}%
__\maketitle
__\thispagestyle{empty}
__\bigskip
__\noindent This is the resulting table.

__\begin{table}[h]
__\input{table.tex}
__\end{table}

__\end{document}

If we wanted to include Stata's variable labels rather than the variable names in the LaTeX table, we could specify the option label (Mark Holmes contributed code for this option). Similarly, if we wanted est2tex to override the column names from est2vec, we could specify replacements using the option collabels(). Both label and collabels() permit the inclusion of LaTeX code in the file table.tex. The option collabels() expects blanks to separate the individual column names from each other. So, for collabels() to assign labels properly, the LaTeX code must be written without any blanks (using the symbol ~ for spacing).

. label var weight "Weight ({\it lbs.})"
. label var weightsq "Squared weight ({\it lbs.}$^2$)"
. label var length "Length ({\it in.})"
. est2tex table, replace preserve path(../texdocs) mark(stars) levels(95 99 99) fancy lab collab("Mileage~$\left(\frac{miles}{gallon}\right)$ Weight~(\emph{lbs.})")

The option levels(95 99 99) in the last command makes sure that only two levels of significance are used to mark the estimates with (zero, one or two) stars (but not with three stars).

The file est2tex.pdf shows the resulting LaTeX table under the above options.

### General Remarks

When invoked after any estimation command, est2vec creates three auxiliary vectors in memory: table_b, table_se and table_e. The vector table_b contains all coefficient estimates from the most recent estimation. The vector table_se lists the according standard errors. The vector table_e contains additional information about the estimation.

By default, table_e has one row named e(N) and lists the number of observations. Additional results saved as e() scalars can be included in table_e by specifying the according e(list_of_macro_names) option. est2vec can store results from r() macros in a fourth vector table_r with option r(list_of_macro_names). This can be useful for reporting test results. Under the r() option, est2vec only forms the vectortable_r.

Generally, tables contain results from more than one estimation. The command est2vec allows to build up tables gradually. Aft table_r if it exists) to one LaTeX table and saves the results in a file table.tex. Any LaTeX document can include that file directly with the TeX command \input{table.tex}. Various options control the style of the LaTeX table in table.tex. Apart from the file table.tex, est2tex creates an according table table_tbl as Stata matrix in memory and saves it to disk in table_tbl.dta. This table can be loaded later with the command matload (see package matsave).

Instead of creating LaTeX output immediately, the command est2one combines the information from matrices table_b, table_se and table_e (and table_r if it exists) to one large Stata matrix table_tbl. This matrix table_tbl can be edited (convenient commands for that purpose may be found in packages stb50/dm69 and stb56/dm79; also see help matrix). Then, the edited matrix can be saved as a LaTeX table with the command est2tex under the option ready.

The name of table is not allowed to coincide with a variable name in memory. Missing estimates are reported as -999 in the Stata matrices and with blanks or dots (option dots) in the LaTeX tables.

### Remarks on est2vec

The command "est2vec table, addto(oldtable)" creates the auxiliary vectors table_b, table_se and table_e. It also adds these vectors to the matrices oldtable_b, oldtable_se and oldtable_e. Under the option nokeep, the auxiliary vectors table_b, table_se and table_e are dropped from memory. In the example above, a slight abuse of syntax did the same: "est2vec oldtable, addto(oldtable)" is equivalent to "est2vec table, addto(oldtable) nokeep".

When assembling estimates from multiple equation regressions (reg3 or mlogit, for instance), est2vec only adds equations that have been specified initially. Consider the following regression from the same automobile dataset as before. The variable rep78 can take five values (1 through 5) that represent the repair record. The command

. mlogit rep78 price mpg foreign, base(1)
(output suppressed)

estimates the probability of categories 2 through 5, relative to category 1, as a function of price, mpg and foreign. We can store the results with

. est2vec table2

All estimates are identified with their according "equation name". These equation names are the categories of rep78 in the case of mlogit:

. matrix list table2_b

________table2_b[16,1]
________________________rep78
__________2:price___.00040825
____________2:mpg__-.02318283
________2:foreign___-18.15009
__________2:_cons__-.20046453
__________3:price____.0004733
____________3:mpg__-.00072598
________3:foreign___19.271375
__________3:_cons___.18466295
__________4:price___.00044831
____________4:mpg___.03087516
________4:foreign___21.364028
__________4:_cons__-1.3762754
__________5:price___.00064603
____________5:mpg___.21926142
________5:foreign___22.223713
__________5:_cons__-8.2147995

If we chose category 5 as base category instead of 1, we would run

. mlogit rep78 price mpg foreign, base(5)
(output suppressed)

Adding these estimates to the preceding table2 with

. est2vec table2, addto(table2) name(rep78_alt)

yields

. matrix list table2_b

________table2_b[16,2]
________________________rep78___rep78_alt
__________2:price___.00040825__-.00023778
____________2:mpg__-.02318283__-.24244424
________2:foreign___-18.15009__-37.373803
__________2:_cons__-.20046453____8.014335
__________3:price____.0004733__-.00017272
____________3:mpg__-.00072598__-.21998739
________3:foreign___19.271375__-2.9523383
__________3:_cons___.18466295___8.3994624
__________4:price___.00044831__-.00019772
____________4:mpg___.03087516__-.18838626
________4:foreign___21.364028__-.85968569
__________4:_cons__-1.3762754___6.8385241
__________5:price___.00064603___________0
____________5:mpg___.21926142___________0
________5:foreign___22.223713___________0
__________5:_cons__-8.2147995___________0

Since equation "5" is not independently identified in the last regression, the according estimates are set to missing in the Stata output (check table_se). On the other hand, equation "1" is left out since it was not identified before.

In some final tables, we may want to show the according estimates. est2vec provides two ways to do so.

First, we can specify the according option vars() initially. (The option shvars() is inappropriate for multiple equation regressions.)

. mlogit rep78 price mpg foreign, base(1)
(output suppressed)
. est2vec table3, vars(1:price 1:mpg 1:foreign 1:_cons 2:price 2:mpg 2:foreign 2:_cons 3:price 3:mpg 3:foreign 3:_cons 4:price 4:mpg 4:foreign 4:_cons 5:price 5:mpg 5:foreign 5:_cons)
. mlogit rep78 price mpg foreign, base(5)
(output suppressed)
. est2vec table3, addto(table3) name(rep78_alt)
. matrix list table3_b

yields

________table3_b[20,2]
________________________rep78___rep78_alt
__________1:price___________0__-.00064603
____________1:mpg___________0__-.21926142
________1:foreign___________0__-37.223714
__________1:_cons___________0___8.2147995
__________2:price___.00040825__-.00023778
____________2:mpg__-.02318283__-.24244424
________2:foreign___-18.15009__-37.373803
__________2:_cons__-.20046453____8.014335
__________3:price____.0004733__-.00017272
____________3:mpg__-.00072598__-.21998739
________3:foreign___19.271375__-2.9523383
__________3:_cons___.18466295___8.3994624
__________4:price___.00044831__-.00019772
____________4:mpg___.03087516__-.18838626
________4:foreign___21.364028__-.85968569
__________4:_cons__-1.3762754___6.8385241
__________5:price___.00064603___________0
____________5:mpg___.21926142___________0
________5:foreign___22.223713___________0
__________5:_cons__-8.2147995___________0

Alternatively, we can specify the option force after the second regression. This forces the estimates from the second regression into the table irrespective of the equations and variables from the first step. We need to make sure that the newly added vectors conform to the previous table. This is satisfied here.

. mlogit rep78 price mpg foreign, base(1)
(output suppressed)
. est2vec table4
. mlogit rep78 price mpg foreign, base(5)
(output suppressed)
. est2vec table4, addto(table4) name(rep78_alt) force
. matrix list table4_b

________table4_b[16,2]
________________________rep78___rep78_alt
__________2:price___.00040825__-.00064603
____________2:mpg__-.02318283__-.21926142
________2:foreign___-18.15009__-37.223714
__________2:_cons__-.20046453___8.2147995
__________3:price____.0004733__-.00023778
____________3:mpg__-.00072598__-.24244424
________3:foreign___19.271375__-37.373803
__________3:_cons___.18466295____8.014335
__________4:price___.00044831__-.00017272
____________4:mpg___.03087516__-.21998739
________4:foreign___21.364028__-2.9523383
__________4:_cons__-1.3762754___8.3994624
__________5:price___.00064603__-.00019772
____________5:mpg___.21926142__-.18838626
________5:foreign___22.223713__-.85968569
__________5:_cons__-8.2147995___6.8385241

Much care is warranted with the force option. Most importantly, the row names in the table only apply to the first but by no means to the second estimation. In fact, the equation numbers underlying the second column are exactly the equation numbers of the first column less one.

### Output to type-setting software other than LaTeX

The command outreg (stb58/sg97_2) produces output files for text editors in general. It offers a different and rich set of options. Sometimes, the combination of two steps (est2vec and est2one) in est2tex may help create tables that are hard to obtain with outreg. For such cases, est2tex offers the option plain() and allows to produce output files similar to those of outreg.

Table3 above, for instance, can be saved in a plain text file with

. est2tex table3, path(../texdocs) dropall plain(tab)