## Stata 15 help for tebalance density

```
[TE] tebalance density -- Covariate balance density

Syntax

Density plots for the propensity score

tebalance density [, options]

Density plots for a covariate

tebalance density varname [, options]

options                    Description
-------------------------------------------------------------------------
Main
kernel(kernel)           specify the kernel function; default is
kernel(epanechnikov)
bwidth(*#)               rescale default bandwidth
line#opts(line_options)  twoway line options for density line number #
twoway_options           any options other than by() documented in
[G-3] twoway_options
byopts(byopts)           how subgraphs are combined, labeled, etc.
-------------------------------------------------------------------------

kernel             Description
-------------------------------------------------------------------------
triangle           triangle kernel function; the default
epanechnikov       Epanechnikov kernel function
epan2              alternative Epanechnikov kernel function
biweight           biweight kernel function
cosine             cosine trace kernel function
gaussian           Gaussian kernel function
parzen             Parzen kernel function
rectangle          rectangle kernel function
-------------------------------------------------------------------------

Menu

Statistics > Treatment effects > Balance > Graphs

Description

tebalance density produces kernel density plots that are used to check
for covariate balance after estimation by a teffects
inverse-probability-weighted estimator, a teffects matching estimator, or
an stteffects inverse-probability-weighted estimator.

Options

+------+
----+ Main +-------------------------------------------------------------

kernel(kernel) specifies the kernel function for use in calculating the
kernel density estimates.  The default kernel is the
kernel(epanechnikov).

bwidth(*#) specifies the factor by which the default bandwidths are to be
rescaled.  A bandwidth is the half-width of the kernel, the width of
the density window around each point.  Each kernel density plot has
its own bandwidth, and by default, each kernel density plot uses its
own optimal bandwidth; see [R] kdensity.  bwidth() rescales each
plot's optimal bandwidth by the specified amount.

line#opts(line_options) specifies the line pattern, width, color, and
overall style of density line number #.  The line numbers are in the
same order as the treatment levels specified in e(tlevels).

twoway_options are any of the options documented in [G-3] twoway_options,
excluding by().  These include options for titling the graph (see
[G-3] title_options) and for saving the graph to disk (see [G-3]
saving_option).  tebalance density uses by() to differentiate between
raw and weighted or matched samples, and some twoway_options will be
repeated for by graph and might be better specified as byopts().

byopts(by_option) is as documented in [G-3] by_options.  byopts() affects
how the subgraphs are combined, labeled, etc.  byopts() generally
affects the entire graph, and some by_option may be better specified
as twoway_options; see [G-3] twoway_options.

Example

Setup
. webuse cattaneo2

Estimate the effect of a mother's smoking behavior (mbsmoke) on the
birthweight of her child (bweight), controlling for marital status
(mmarried), the mother's age (mage), whether the mother had a prenatal
doctor's visit in the baby's first trimester (prenatal1), and whether
this baby is the mother's first child (fbaby)
. teffects psmatch (bweight) (mbsmoke mmarried mage prenatal1 fbaby),
generate(matchv)

Look at the default density plots
. tebalance density mage

Stored results

After teffects or stteffects fits a binary treatment, tebalance density
stores the following in r():

Scalars
r(bwc_adj)          bandwidth for control in weighted or
matched-adjusted sample
r(Nc_adj)           observations on control in weighted or
matched-adjusted sample
r(bwt_adj)          bandwidth for treated in weighted or
matched-adjusted sample
r(Nt_adj)           observations on treated in weighted or
matched-adjusted sample
r(bwc_raw)          bandwidth for control in raw sample
r(Nc_raw)           observations on control in raw sample
r(bwt_raw)          bandwidth for treated in raw sample
r(Nt_raw)           observations on treated in raw sample

Macros
r(kernel)           name of kernel

After teffects or stteffects fits a multivalued treatment, tebalance
density stores the following in r():

Scalars
r(bw#_adj)          bandwidth for treatment level # in weighted or
matched-adjusted sample
r(N#_adj)           observations on treatment level # in weighted or
matched-adjusted sample
r(bw#_raw)          bandwidth for treatment level # in raw sample
r(N#_raw)           observations on treatment level # in raw sample

Macros
r(kernel)           name of kernel

```

 © Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index