*! version 1.1.0 30nov2012
help dmout

Title

dmout -- Produce tables of difference in means tests

Syntax

dmout varlist [if] [in] [weight] using filename
, by(varname) [options]

Main
by(varname) Group variable to take differences; Must take two values, string or numeric OK

iv(varname) Exogenous variable for IV analysis; Must take two values, string or numeric OK

ctrlvars(varlist) Include control variables in difference (and IV) estimation

vce(vcetype) Any vce accepted by regress (and ivregress) command

stat(stat) Report either se or pval for difference estimates; default is se

cw Casewise exclusion of observations with missing data

Output
list Display table in results window

detail Display detailed regression results

using Output file name; do not include .suffix

replace Replace the output file, if it exists

append Append results to existing output file

csv Create csv output file

txt Create tab-delimited text output file

tex Create tex output file

preamble include tex preamble

enddoc include tex end of document

Table
title(title) Table title

subtitle(subtitle) Table subtitle

caption(caption) Table caption

decimal(#) Decimal places for reporting levels. Differences have one additional decimal place.

notes(notes) Table notes: enclose multiple notes in quotes

aweights, fweights, iweights, and pweights are allowed; see weight.

Description

dmout produces difference-in-means tables. Means of each variable in varlist
are compared across the values of the by() variable. dmout is useful
when comparing several variables across two groups, such as treatment and control
groups in an RCT, or attriters and non-attriters in longitudinal data.

The two groups should be designated by the by() variable. by() may be a
numeric or string variable. It must take exactly two values within the analysis sample.
Column headings are taken from the value labels of the by() variable. Row labels
are taken from the variable label of each variable in varlist.

Mean/difference estimates, standard errors, and p-values are computed using regress or ivregress.
If the default, non-robust standard errors are used for a simple difference estimate, the
p-values calculated by dmout are equivalent those from a two-group, two-tailed
ttest where the groups have equal variance (pooled).

The analysis sample may change between the dependent variables specified in varlist, due to
missing data. By default, the full sample is used for each dependent variable. Sample size is
reported in the table anytime the current regression has a different sample size than the
preceding regression. To use a single, non-missing sample, the user may specify the cw option.

Options

Main

by(varname) specifies the group variable over which to take differences. The variable may
be string or numeric, but it must take exactly two values within the estimation sample.

iv(varname) specifies the exogenous variable for IV analysis. The variable may
be string or numeric, but it must take exactly two values within the estimation sample. IV
estimates will be recorded in a new column.

ctrlvars(varlist) Include control variables in difference estimation. Difference coefficient
from regression with controls will be recorded in a new column. If the IV option is specified,
an additional column will be included for IV estimates with controls.

vce(vcetype) specifies the type of standard error reported. This option is passed through to the
regress or ivregress command. If the iv(varname) option is used, the vcetype should be consistent
with both regress and ivregress. Otherwise it just needs to be consistent with regress.

stat(stat) specifies the statistice to report in the table. It may be either se for
standard errors, or pval for p-values. The default is se.

cw specifies casewise exclusion of observations with missing data. The default behavior uses the full
available data for each dependent variable. If the number of observations differs between two rows
of the table, a line is printed with the number of observations used in the previous regression(s).

Output

using specifies the file name to save output. Do not include any suffix with the file name. The suffix
will be added according to the selected output format, csv, tex, or txt.

csv creates a comma-separated-value output file. Rows are named by variable label. If the variable label
contains a comma, it will incorrectly increment the column alignment.

txt creates a tab-delimited output file.

tex creates a LaTeX output file. No provision is made to escape special LaTeX characters. Table rows are
named with variable labels if present, and variable names otherwise. Avoid special LaTeX characters in variable
labels or names. This includes underscores in variable names (unless they are labeled). LaTeX output relies
on the following packages: geometry, threeparttable, booktabs, dcolumn. These packages are specified if the
preamble option is specified.

preamble includes the LaTeX preamble in the .tex output file.

enddoc includes the LaTeX end of document statement in the .tex output file.

list Display table in results window. May be used in conjunction with an output file or in place
of an output file.

replace replaces the output file, if the output file already exists.

append appends the current table to the existing output file, if the output file already exists.

Table

title(title) specifies the table title.

subtitle(subtitle) specifies the table subtitle, which appears below the title.

caption(caption) specifies the table caption. The table caption is primarily used for LaTeX output. For other output
file types, the caption appears above the title caption.

decimal(#) specifies the number of decimal places for reporting levels of variables. Differences have one additional decimal place.

notes(notes) specifies table notes to appear at the bottom of the table. Two notes appear by default. The
first describes how stars are printed in the table according to coefficient significance levels. The second
specifies whether standard errors or p-values are reported under coefficients. If control variables are used, a third
automatic note is generated listing the control variables. To specify multiple additional
notes, enclose each note in quotation marks.

Examples

. sysuse auto.dta

. dmout weight mpg length using automeans , by(foreign) csv list

Author

Michael Barker

Georgetown University

mdb96@georgetown.edu

Also see

Net:
outreg2 ,
tabout ,
outtable ,
estout ,
diff