Title

estat (after trop) -- Postestimation statistics for trop

Syntax

estat subcommand [, options]

subcommand

summarize sample and treatment structure summary

weights weight diagnostics

loocv LOOCV hyperparameter selection diagnostics

factors factor matrix (L) SVD analysis

bootstrap bootstrap distribution diagnostics

sensitivity hyperparameter sensitivity analysis

vce variance-covariance matrix

triplerob triple-robustness bias decomposition (Theorem 5.1)

distance unit distance distribution diagnostics

mht multiple hypothesis testing correction

eventstudy event-study analysis (twostep only)

pretrend pre-trend test (twostep only)

table export results as formatted table (LaTeX/Markdown/CSV)

Abbreviations are shown by underlining.

Description

estat displays postestimation diagnostics after trop. Thirteen
subcommands are provided for inspecting the estimation sample, weight
distributions, hyperparameter selection, factor structure, bootstrap
inference, sensitivity of the LOOCV objective, the variance-covariance
matrix, triple-robustness bias decomposition, unit distance distribution,
multiple hypothesis testing, event-study analysis, pre-trend testing,
and publication-quality table export.

All subcommands require that trop has been executed previously. If no
trop estimates are found in e(), error code 301 is returned.

Subcommands

estat summarize

estat summarize [, detailed]

Displays a summary of the estimation sample structure and treatment
distribution, including the number of units (N), periods (T), total
observations, treated and control observation counts, treatment adoption
pattern, outcome variable descriptive statistics, and estimation method.

Options:

detailed displays a guide for tabulating the unit-by-period treatment
distribution in the original dataset.

estat weights

estat weights [, heatmap detailed]

Displays weight diagnostics. Output differs by estimation method:

Twostep method: A note is displayed indicating that weights vary by
treated observation. Summary statistics (mean, standard deviation, minimum,
maximum) are reported for the time weights (theta, T x 1) and unit weights
(omega, N x 1) associated with the first treated observation. This is the
paper's main Algorithm 2 path and permits heterogeneous treatment effects.

Joint method: Summary statistics are reported for the global time
weights (delta_time, T x 1) and unit weights (delta_unit, N x 1). This is
the shared-weight Remark 6.1 extension, intended for homogeneous effects in
simultaneous-adoption settings.

Options:

heatmap generates a heatmap of the weight matrix. If e(W_mat) is
available it is used directly; otherwise an outer-product approximation is
constructed from the weight vectors. Requires the user-written command
heatplot (install via ssc install heatplot).

detailed displays the 10th, 25th, 50th, 75th, and 90th percentiles of
the weight vectors.

estat loocv

estat loocv [, stability table2]

Displays LOOCV hyperparameter selection diagnostics, including:

- Selected hyperparameters (lambda_time, lambda_unit, lambda_nn)

- LOOCV objective value Q(lambda_hat)

- Valid fits count and percentage

- Grid style used

- Method-specific search mode in effect for the preceding trop call

- First failed observation coordinates (if any)

- Warning if failure rate exceeds 10%

With the stability option, the following additional diagnostics are
appended:

- LOOCV search strategy in effect (cycling or exhaustive
for the method used by the preceding trop call)

- Size and [min, max] range of each lambda grid

- Boundary-hit flags when the selected lambda coincides with the
lowest or highest finite grid point, suggesting the grid should be
widened. The . (Stata missing = +infinity) corner of
lambda_nn is recognised as a legitimate DID/TWFE solution and is
never flagged.

With the table2 option, the command appends a per-dataset coverage
report for the seven benchmark applications of Table 2 in Athey et al.
(2025): CPS log-wage, CPS unemployment rate, PWT log-GDP, West Germany,
Basque, California Smoking, and Mariel Boatlift. For every benchmark the
report checks whether the optimal
(lambda_unit, lambda_time, lambda_nn) triplet reported in the paper is
present in the lambda grids actually used by the preceding trop call.
When a value is missing, the report suggests switching to
grid_style(extended) or adding the missing value to the corresponding
lambda_*_grid() option. This diagnostic requires that the previous
trop call performed LOOCV (i.e. no fixedlambda()).

estat factors

estat factors

Displays an analysis of the low-rank factor matrix L via singular value
decomposition (SVD), including:

- Matrix dimensions (T x N)

- Effective rank (singular values above tolerance)

- Top singular values with variance explained

- Matrix norms (Frobenius, Nuclear)

estat bootstrap

estat bootstrap [, graph]

Displays bootstrap distribution diagnostics. This subcommand requires that
the bootstrap() option was specified in the original trop command.

The reported dispersion summaries are descriptive summaries of the stored
bootstrap ATT draws. The variance denominator used for the official
reported e(se) remains the one selected at estimation time through
bsvariance(sample|paper).

Output includes:

- Number of bootstrap samples and valid samples

- ATT distribution statistics (mean, standard deviation, median, IQR)

- Percentiles (2.5%, 5%, 25%, 50%, 75%, 95%, 97.5%)

- Normality test (Jarque-Bera statistic and p-value)

Options:

graph plots a histogram of the bootstrap distribution with a normal
density overlay, the point estimate, and confidence interval reference lines.

estat sensitivity

estat sensitivity [, graph table(#)]

Displays hyperparameter sensitivity analysis based on the LOOCV grid search
results. Reports the search range for each regularization parameter, the
selected optimum, the LOOCV score, and boundary diagnostics.

When full grid evaluation data are available (more than half of the Cartesian
product has valid CV scores), a ranked table of top grid points by CV loss is
displayed together with sensitivity metrics (coefficient of variation, loss
range, relative range).

Options:

graph plots the CV loss curve. Available only when full grid evaluation
data exist and a single regularization parameter varies.

table(#) specifies the number of top grid points to display; default is
table(10).

estat vce

estat vce [, correlation]

Displays the variance-covariance matrix of the estimates. Because the TROP
estimator produces a scalar ATT, the matrix e(V) is 1 x 1. The
standard error, variance estimation method, and bootstrap replication count
(if applicable) are also reported. When bootstrap inference was used, the
display also reports whether the SE uses the default sample denominator
1/(B-1) or the paper denominator 1/B.

Options:

correlation is accepted for interface compatibility but has no effect
on the display because the TROP variance-covariance matrix is scalar (1 x 1).

estat triplerob

estat triplerob [, rank(#) topk(#)]

Reports a diagnostic decomposition of the paper Theorem 5.1 bias bound

|E[tau_hat - tau | L]| <= ||Delta^u(omega, Gamma)||_2 * ||Delta^t(theta, Lambda)||_2 * ||B||_*

as three factors, computed from e(factor_matrix), the method-specific
weight vectors, and the rank-k singular-value decomposition of the estimated
L matrix.

Interpretation. Gamma (N x k) and Lambda (T x k) are the unit
loadings and time factors of the rank-k truncation of L. The first two
imbalance terms measure how much the fitted weights fail to reproduce the
target unit's loading / target period's factor on average over the treated
cells. The third term measures the nuclear mass discarded by the rank-k
truncation. The product is a diagnostic proxy for the Theorem 5.1 upper
bound; a small value relative to the bootstrap standard error suggests the
triple-robustness guarantee is well satisfied.

For method(joint) the global weights e(delta_time) and
e(delta_unit) are used, and the imbalance terms are averaged over all
treated cells. For method(twostep) only e(theta) and
e(omega) are stored, which describe the weights at the first treated
cell; the reported decomposition is therefore a conservative proxy for
that cell.

Options:

rank(#) overrides the truncation rank k used for the SVD decomposition
of L. Default is ceil(e(effective_rank)), capped at min(T, N).
Higher rank retains more singular mass (smaller residual term) but may
inflate the two imbalance terms if additional components are poorly
balanced.

topk(#) controls how many leading singular values are tabulated in
the header (default 3).

Stored results (in r()):

r(delta_unit) ||Delta^u||_2 averaged over treated cells

r(delta_time) ||Delta^t||_2 averaged over treated cells

r(residual) nuclear mass discarded by rank-k truncation

r(bias_bound) product of the three factors

r(rank) truncation rank used

r(method) twostep or joint

estat distance

estat distance [, graph saving(filename) bins(#)]

Displays unit distance distribution diagnostics. The pairwise distances
between panel units are computed as the root-mean-squared difference in
outcomes across shared control periods (Paper Eq. 3).

Output includes the distance distribution summary (mean, standard deviation,
min, max, percentiles) and optionally publication-quality diagnostic plots.

Options:

graph displays publication-quality weight diagnostic plots including
a distance distribution histogram, unit weights vs distance scatter, and
time weight decay curve (when lambda parameters are available).

saving(filename) saves the combined diagnostic graph to filename.
Requires the graph option.

bins(#) specifies the number of histogram bins; default is
bins(30).

Stored results (in r()):

r(mean_dist) mean pairwise distance

r(sd_dist) standard deviation of distances

r(min_dist) minimum distance

r(max_dist) maximum distance

r(N_pairs) number of pairwise distances

estat mht

estat mht [, method(string) source(string) alpha(#)]

Performs multiple hypothesis testing correction on treatment effects
obtained from trop.

Three correction methods are available:

- bonferroni: Bonferroni correction (FWER): p_adj_i = min(K * p_i, 1)

- holm: Holm step-down (FWER): sequential correction

- bh: Benjamini-Hochberg (FDR): sequential correction (default)

Options:

method(string) specifies the correction method; one of bonferroni,
holm, or bh (default).

source(string) specifies the source of effects; one of cells
(individual cell-level effects from e(tau_matrix), requires
method(twostep)) or eventstudy (event-study horizon effects
from a prior estat eventstudy call). Default is cells.

alpha(#) specifies the significance level; default is 0.05.

Stored results (in r()):

r(method) correction method used

r(alpha) significance level

r(K) number of hypotheses tested

r(n_reject) number of rejections after correction

r(table) matrix of corrected p-values and decisions

estat eventstudy

estat eventstudy [, window(numlist) reference(#)
placebo placebo_periods(#) graph nograph
level(#) title(string) saving(string)
connect cicolor(string) mcolor(string)
msymbol(string) msize(string)]

Aggregates individual treatment effects tau_ by relative event time
(horizon h = t - g_i) and optionally performs pre-trend testing. This
subcommand requires method(twostep) because only that method produces
cell-level treatment effects in e(tau_matrix).

Options:

window(numlist) specifies the event-time window [min, max] to
display; default spans the full available range.

reference(#) specifies the reference period for normalization;
default is -1 (the last pre-treatment period).

placebo performs a pre-trend (placebo) test using the pre-treatment
horizons.

placebo_periods(#) specifies the number of pre-treatment periods
used for the placebo test; default is 3.

graph displays an event-study plot with point estimates and
confidence intervals.

nograph suppresses the event-study plot.

level(#) specifies the confidence level; default is level(95).

title(string) specifies a custom title for the graph.

saving(string) saves the graph to a file.

connect connects point estimates with a line across horizons.

cicolor(string) specifies the colour for confidence interval caps;
default is "24 105 175" (publication blue).

mcolor(string) specifies the marker and line colour for point
estimates; default is "24 105 175".

msymbol(string) specifies the marker symbol; default is O
(circle). See symbolstyle.

msize(string) specifies the marker size; default is
medsmall. See markersizestyle.

Stored results (in r()):

r(table) matrix of event-study estimates (horizon, ATT, SE, CI)

r(n_horizons) number of event-time horizons

r(pretrend_F) pre-trend F-statistic (if placebo specified)

r(pretrend_p) pre-trend p-value (if placebo specified)

estat pretrend

estat pretrend [, periods(#) level(#) robust]

Tests the null hypothesis that all pre-treatment effects are jointly zero:

H0: tau(-K) = tau(-K+1) = ... = tau(-1) = 0

This subcommand requires method(twostep) because only that method
produces cell-level treatment effects in e(tau_matrix). The test
uses a simplified Wald statistic with a chi-squared reference distribution.

Options:

periods(#) specifies the number of pre-treatment periods to include
in the test. Default uses all available pre-treatment periods.

level(#) specifies the significance level for the pass/fail decision;
default is 95.

robust uses the bootstrap covariance matrix for the pre-treatment
period effects (if available from a prior estat eventstudy call)
instead of the default diagonal covariance assumption.

Stored results (in r()):

r(chi2) Wald chi-squared test statistic

r(df) degrees of freedom (number of pre-periods tested)

r(p) p-value

r(pretrend_pass) 1 if cannot reject H0 at the given level, 0 otherwise

r(n_preperiods) number of pre-treatment periods used

estat table

estat table [, format(string) saving(filename) title(string)
notes(string) stars append replace decimals(#)]

Produces a publication-quality results table from the e() values
stored after a trop estimation command. Supports four output formats
and optional significance stars.

Options:

format(string) specifies the output format; one of display (Stata
console table, default), latex (LaTeX tabular environment in AER/QJE
style), markdown (GitHub-flavored Markdown table), or csv
(comma-separated values).

saving(filename) writes the formatted table to filename. If the
file already exists, replace or append must be specified.

title(string) specifies a custom table title; default is
"TROP Estimation Results".

notes(string) appends a footnote below the table (LaTeX, Markdown,
and CSV formats only).

stars appends significance stars to the ATT estimate: ***
p<0.01, ** p<0.05, * p<0.1.

append appends output to an existing file specified by saving().

replace overwrites an existing file specified by saving().

decimals(#) specifies the number of decimal places for numeric values;
default is 4.

Examples

Setup

. clear all

. set seed 12345

. set obs 1000

. gen id = ceil(_n/10)

. bysort id: gen t = _n

. gen y = rnormal() + 0.5*(id>80)*(t>7)

. gen d = (id > 80 & t > 7)

Run trop with bootstrap

. trop y d, panelvar(id) timevar(t) seed(42) bootstrap(200)

Sample summary

. estat summarize

LOOCV diagnostics

. estat loocv

Weight diagnostics

. estat weights

Weight diagnostics with percentiles

. estat weights, detailed

Factor matrix analysis

. estat factors

Bootstrap distribution

. estat bootstrap

Bootstrap distribution with histogram

. estat bootstrap, graph

Hyperparameter sensitivity

. estat sensitivity

Variance-covariance matrix

. estat vce

Triple-robustness bias decomposition (Theorem 5.1)

. estat triplerob

Same with a rank-2 truncation

. estat triplerob, rank(2)

Unit distance distribution

. estat distance

Weight diagnostic plots

. estat distance, graph

Save diagnostic panel to file

. estat distance, graph saving(weight_diag.png)

Multiple hypothesis testing (Benjamini-Hochberg)

. estat mht

Bonferroni correction at 1% level

. estat mht, method(bonferroni) alpha(0.01)

Event-study analysis (requires twostep)

. estat eventstudy

Event study with graph and placebo test

. estat eventstudy, graph placebo

Event study with custom graph options

. estat eventstudy, graph connect mcolor("0 100 0") msymbol(D)

Pre-trend test

. estat pretrend

Pre-trend test with 5 pre-periods at 99%% level

. estat pretrend, periods(5) level(99)

Export results as formatted table

. estat table

Export LaTeX table with significance stars

. estat table, format(latex) stars saving(results.tex)

Export Markdown table

. estat table, format(markdown) saving(results.md)

Export CSV with custom title

. estat table, format(csv) title("Model 1") saving(results.csv)

Stored results

The estat subcommands do not modify the estimation results in e().
All displayed statistics are computed from the e() results stored by
trop. The exception is estat triplerob, which also stores the
diagnostic scalars documented above in r(). See
trop stored results for the complete list of scalars,
macros, and matrices available after estimation.

Methods and formulas

estat weights

For the twostep method, time weights theta_s and unit weights omega_j are
computed as exponential-decay functions of distance (Eq. 3 of Athey et al.,
2025):

theta_s = exp(-lambda_time * |t - s|)

omega_j = exp(-lambda_unit * dist(j, i))

where dist(j, i) is the root-mean-squared difference in outcomes between
units j and i over shared control periods. For the joint method, the
analogous global weights are delta_time (T x 1) and delta_unit (N x 1).

estat loocv

The LOOCV objective Q(lambda) is defined as (Eq. 5):

Q(lambda) = sum_ (1 - W_) * (tau_hat_(lambda))^2

where tau_hat_(lambda) is the estimated pseudo-treatment effect for
control observation (i, t). Hyperparameters are selected via coordinate
descent (cycling) over the grid of (lambda_time, lambda_unit, lambda_nn).

estat factors

The effective rank of the factor matrix L is computed via SVD as
sum(s) / s[1], where s is the vector of singular values. This continuous
measure indicates the degree to which the low-rank component concentrates on
a small number of factors.

estat bootstrap

The cluster bootstrap resamples N_0 control units and N_1 treated units with
replacement, re-estimating the TROP estimator for each replicate. The
reported dispersion summaries are descriptive summaries of the stored
bootstrap draws. The official e(se) uses the denominator selected at
estimation time via bsvariance(sample|paper); the paper denominator is:

V_hat = (1/B) * sum_^ (tau_hat^(b) - tau_bar)^2

while the default bsvariance(sample) replaces 1/B with
1/(B-1).

Normality of the bootstrap distribution is assessed via the Jarque-Bera
statistic: JB = (B/6) * [S^2 + (1/4)(K - 3)^2], where S is skewness and K
is kurtosis. Under the null of normality, JB follows a chi-squared
distribution with 2 degrees of freedom.

estat sensitivity

Sensitivity metrics include the coefficient of variation of CV loss across
grid points, the loss range, and the relative range. Boundary diagnostics
check whether the selected optimum lies at the edge of the search grid.

estat triplerob

Starting from the rank-k SVD L = U * diag(s) * V' where U (T x r),
V (N x r), and s is the vector of singular values in non-increasing
order, the paper Theorem 5.1 bias bound is

|E[tau_hat - tau | L]| <= ||Delta^u(omega, Gamma)||_2 * ||Delta^t(theta, Lambda)||_2 * ||B||_*

with

Gamma_ = V[i, 1..k], Lambda_ = U[t, 1..k]

Delta^u(omega, Gamma) = sum_j omega_j * Gamma_ - Gamma_

Delta^t(theta, Lambda) = sum_s theta_s * Lambda_ - Lambda_

||B||_* ~= sum_ s_h (nuclear mass discarded by truncation)

where (i*, t*) indexes a treated cell. The ||.||_2 terms are L2 norms
over the k-component loadings. For method(joint) the reported
||Delta^u||_2 and ||Delta^t||_2 are arithmetic means over all treated
cells with the global weights e(delta_unit), e(delta_time).
For method(twostep) only the first-treated-cell weights
e(omega), e(theta) are available in e(), and the
decomposition reports those cell-specific quantities.

References

Athey, S., G. W. Imbens, Z. Qu, and D. Viviano. 2025.
Triply robust panel estimators.
arXiv preprint arXiv:2508.21536.

Author

Xuanyu Cai

City University of Macau

xuanyuCAI@outlook.com

Wenli Xu

City University of Macau

wlxu@cityu.edu.mo

Also see

Online: trop, trop_estat, trop_predict