help xtgets version 1.0.0

Title

xtgets -- Panel General-to-Specific (GETS) Indicator
Saturation for Structural Break Detection

Version

Version 1.0.0, 14 March 2026

Author: Dr Merwan Roudane (merwanroudane920@gmail.com)

Based on: Pretis, F. and Schwarz, M. (2022/2026). "Discovering What Mattered:
Detecting Unknown Treatment as Breaks in Panel Models". SSRN 4022745.

R implementation: getspanel package (CRAN)
by Felix Pretis and Moritz Schwarz.

Original time-series gets.ado: Damian C. Clarke, University of Oxford (2013).

Syntax

xtgets depvar [indepvars] [if] [in] [weight] ,
saturation_methods [options]

At least one saturation method (iis, jiis, jsis, fesis,
csis, cfesis, or tis) is required. You may combine multiple
methods in a single call (e.g. fesis iis). When multiple methods are
specified the command uses a two-stage GETS selection: structural indicators
(FESIS/JSIS/CSIS/CFESIS/TIS) are selected first, then outlier indicators
(IIS/JIIS) are selected conditional on the retained structural indicators.

Default significance: t.pval = 0.001 (matching the R getspanel default), which
gives tlimit = invnormal(1 - 0.001/2) = 3.291. At this strict threshold,
the expected share of spuriously retained indicators is 0.1%.

Indicator Saturation Methods (at least one required)
iis Impulse Indicator Saturation (unit-specific outlier detection)

jiis Joint Impulse Indicators (common outliers = time FE selection)

jsis Joint Step Indicators (common structural breaks across units)

fesis Fixed-Effect Step Indicator Saturation (unit-specific step-shifts)

csis Coefficient Step Indicators (common coefficient structural change)

cfesis Coefficient-FE Step Indicators (unit-specific coefficient breaks)

tis Trend Indicator Saturation (unit-specific broken trends)

Model specification
effect(string) Fixed effects type: twoways (default), individual, time, none

t_pval(#) Two-sided p-value threshold for indicator retention; default 0.001

tlimit(#) Absolute t-statistic threshold (overrides t_pval if > 0)

numsearch(#) Number of independent search paths; default 1

vce(vcetype) Variance-covariance estimator (e.g. robust, cluster)

cluster(varname) Cluster variable for clustered standard errors

nopartition Skip out-of-sample partition tests

ar(#) Include autoregressive lags of the dependent variable; default 0

Subset restrictions
fesis_id(numlist) Restrict FESIS to specific panel units

fesis_time(numlist) Restrict FESIS to specific time periods

tis_id(numlist) Restrict TIS to specific panel units

tis_time(numlist) Restrict TIS to specific time periods

csis_var(varlist) Restrict CSIS to specific regressors (default: all)

csis_time(numlist) Restrict CSIS to specific time periods

cfesis_id(numlist) Restrict CFESIS to specific panel units

cfesis_var(varlist) Restrict CFESIS to specific regressors (default: all)

cfesis_time(numlist) Restrict CFESIS to specific time periods

Display
verbose Display detailed screening and refinement progress

nodiagnostic Suppress diagnostics and false discovery rate table

plot Automatically produce default plot after estimation

You must xtset your data before using xtgets; see xtset.

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

The data must be a balanced or unbalanced panel identified by xtset panelvar timevar.

Description

xtgets implements Indicator Saturation methods for
panel data using automated General-to-Specific (GETS) model selection.
The command detects when and where structural breaks occurred in panel
fixed-effects models, without requiring the researcher to pre-specify
the timing or location of any break.

Why use xtgets? Traditional panel estimators (e.g. TWFE, diff-in-diff)
require the researcher to specify exactly which units were treated and when.
xtgets reverses this logic: it starts from the outcome and
discovers treatment timing, magnitude, and assignment by searching over
a large set of candidate break indicators and retaining only those that are
statistically significant. This is what Pretis and Schwarz (2022) call the
reverse causal approach.

How does it work?

1. A candidate indicator matrix is constructed from thousands of
potential break dummies. The type of dummies depends on the saturation method
chosen (e.g. FESIS creates step-shifts per unit, IIS creates impulse dummies per
observation).

2. Each candidate indicator is pre-screened by an individual t-test
against the base model (regressors + fixed effects). Only indicators whose
|t| >= tlimit survive screening.

3. All surviving indicators enter a joint regression and are
iteratively eliminated one by one (backward elimination), dropping the least
significant indicator at each step, until all remaining indicators satisfy
|t| >= tlimit.

4. The final model is estimated with regressors + fixed effects +
retained indicators, and results are displayed in the standard Stata regression
table together with a formatted summary of detected breaks.

Important design feature: Two-stage selection. When structural indicators
(FESIS/CSIS/CFESIS/TIS/JSIS) are combined with outlier indicators (IIS/JIIS),
selection occurs in two stages:

Stage 1: Structural break indicators are selected first.
These capture permanent level shifts or coefficient changes.

Stage 2: Outlier indicators (IIS/JIIS) are then selected conditional
on the Stage 1 retained indicators. This prevents impulse dummies from absorbing
structural breaks that should be captured as parsimonious step-shifts.

Connection to difference-in-differences. Pretis and Schwarz (2022, Theorem 1)
prove that a TWFE model saturated with FESIS indicators nests the standard
staggered diff-in-diff (DID) estimator as a special case. If treatment is a simple
step-shift in the intercept for a subset of units, FESIS recovers exactly the same
estimator as a correctly specified DID design. The advantage of xtgets is
that it does not require prior knowledge of which units are treated or when
treatment occurred.

Indicator Saturation Methods in Detail

This section explains each indicator saturation method in depth, including
what it detects, how the indicator matrix is constructed, how to interpret
retained indicators, and when to use each method.

IIS - Impulse Indicator Saturation

What it detects: Unit-specific one-time outliers (abnormal values at a single
observation). These can be measurement errors, one-off shocks (e.g. a natural
disaster), crises, or unusual data points.

Indicator matrix: IIS creates one 0/1 impulse dummy for every observation in
the panel. In a panel with N units and T time periods, this produces
N x T candidate indicators. For example, the indicator _iis_3_2008 equals 1 only
for unit 3 in year 2008 and 0 everywhere else.

Interpretation: A retained IIS indicator iisi.t with coefficient
beta means that the dependent variable for unit i at time t was
unexpectedly high (beta > 0) or low (beta < 0) by that magnitude, conditional on
the model. Think of it as a cleaned residual: the model could not explain this
observation without a special dummy.

Relationship to robust estimation: IIS is mathematically equivalent to a
Huber-skip robust estimator (Hendry, Johansen, and Santos, 2008; Johansen and
Nielsen, 2009). It identifies observations with large residuals and effectively
down-weights them.

When to use: Always consider using IIS in combination with structural methods
(FESIS, CSIS, etc.). This ensures that outliers do not distort the detection of
permanent structural breaks. IIS alone does not distinguish between a one-time
shock and the first period of a permanent shift.

Practical tip: With large panels, IIS adds many candidates (N*T), which
increases the false discovery rate. Use stricter thresholds (smaller t_pval).

Example: An impulse in 2002 for country 4 (iis4.2002) with coefficient -0.14
means that country 4's dependent variable was 0.14 units below what the model
predicted for that single year, possibly due to a recession or data anomaly.

FESIS - Fixed-Effect Step Indicator Saturation

What it detects: Permanent level shifts (step-changes) in a unit's intercept.
This is the most commonly used method. It answers: "Did unit i experience a
permanent upward or downward shift in its outcome starting at time t?"

Indicator matrix: FESIS creates one step dummy for every unit x time-period
combination, excluding the first time period (since a step at t=1 spans the entire
sample and is collinear with the unit fixed effect). In a panel with N units and
T periods, this yields N x (T-1) candidate indicators. For example,
_fesis_3_2008 equals 1 for unit 3 from year 2008 onward, and 0 before 2008.

Interpretation: A retained FESIS indicator fesisi.t with
coefficient tau means that unit i experienced a permanent change in its
intercept of magnitude tau starting from period t. This is exactly the causal
treatment effect in a staggered DID framework:

- tau > 0: unit i's outcome permanently increased by tau units from
period t onward, compared to the counterfactual (no break).

- tau < 0: unit i's outcome permanently decreased by |tau| units.

Equivalence to diff-in-diff: Under the parallel trends assumption, a retained
FESIS coefficient is exactly the Average Treatment Effect on the Treated (ATT) for
unit i starting at time t. The advantage over standard DID is that
xtgets discovers which units were treated and when, rather than requiring
this information ex ante.

When to use: Use FESIS whenever you suspect permanent (or long-lasting) level
changes in individual units, for example due to policy interventions, regime changes,
economic shocks, or any event that permanently shifts the mean of the outcome.

Practical examples from the literature:

Koch et al. (2022, Nature Energy) used FESIS to detect when EU countries
reduced road CO2 emissions, attributing reductions to specific policy mixes without
pre-specifying treatment dates.

Pretis and Schwarz (2022) applied FESIS to EU emissions data to detect
permanent level shifts in log(transport emissions) as a function of log(GDP) and
log(population).

Example: fesis3.2008 with coef 0.48 and fesis7.2010 with coef -0.40 means
country 3 experienced a permanent 0.48-unit increase from 2008, while country 7
experienced a permanent 0.40-unit decrease from 2010.

CSIS - Coefficient Step Indicator Saturation

What it detects: Structural change in slope (regression) coefficients common
to all units. While FESIS detects shifts in the intercept (level), CSIS
detects shifts in the slope (the marginal effect of a regressor on the
outcome).

Indicator matrix: For each regressor X specified in csis_var() and each
time period t (excluding the first), CSIS creates an interaction: step(t>=q) x X.
With K regressors and T periods, this yields K x (T-1) candidate indicators. If
csis_var() is not specified, all regressors are tested.

Interpretation: A retained CSIS indicator csis.X.t with coefficient
delta means that the slope of variable X on the dependent variable changed by delta
for all units starting at period t. The total slope after the break is
the original beta + delta. For example:

csis.lgdp.2005 with coef -0.19 means that from 2005 onward, the elasticity
of emissions with respect to GDP decreased by 0.19 for all countries. If the
original GDP coefficient was 0.80, then the effective coefficient from 2005 is
0.80 - 0.19 = 0.61.

When to use: Use CSIS when you suspect that the relationship between
variables has changed over time for all units simultaneously (e.g. a global policy
shift, technological change, or structural transformation).

Important note: CSIS tests for common coefficient changes across all
units. For unit-specific coefficient changes, use CFESIS instead.

CFESIS - Coefficient-FE Step Indicator Saturation

What it detects: Unit-specific structural change in slope coefficients. This
is the unit-specific analogue of CSIS: it allows the marginal effect of a regressor
to change differently across individual units.

Indicator matrix: For each unit i, each candidate regressor X (from
cfesis_var()), and each time period t > 1, CFESIS creates an interaction:
I(unit=i) x step(t>=q) x X. With N units, K regressors, and T periods, this
produces N x K x (T-1) candidate indicators, which can be very large.

Interpretation: A retained CFESIS indicator cfesis.X.i.t with
coefficient delta means that for unit i specifically, the slope of variable X
changed by delta starting at period t.

When to use: Use CFESIS when the effect of a variable might change differently
for different units, e.g. country-specific policy responses. Because of the large
number of candidates (N x K x T), consider restricting to specific variables
(cfesis_var()) or units (cfesis_id()) to keep computation manageable.

TIS - Trend Indicator Saturation

What it detects: Broken linear trends for specific units from specific dates.
While FESIS detects a permanent level shift (a one-time jump), TIS detects a
trend break (a gradual, linearly increasing or decreasing divergence over
time).

Indicator matrix: For each unit i and each time period t > 1, TIS creates:
trend_indicator = I(unit=i & time>=q) x (time - q + 1). This variable equals 0
before q and increases linearly from 1, 2, 3, ... from period q onward. Total
candidates: N x (T-1).

Interpretation: A retained TIS indicator tisi.t with coefficient
delta means that from period t onward, unit i had a linear trend in the
outcome that grew by delta per period. After s periods post-break, the cumulative
effect is delta x s.

Example: tis5.2008 with coefficient 0.02 means that from 2008, unit 5's
outcome increased by 0.02 per year (cumulative: +0.02 in 2008, +0.04 in 2009,
+0.06 in 2010, etc.).

When to use: Use TIS when you expect gradual, progressive treatment effects
rather than abrupt level shifts. For example, a new technology that diffuses
gradually, or a policy whose impact accumulates over time. Follow
Castle, Doornik, and Hendry (2025) for the theoretical foundations.

JIIS - Joint Impulse Indicator Saturation

What it detects: Common one-time shocks affecting all units simultaneously
at a specific time period. Equivalent to selecting time fixed effects.

Indicator matrix: One impulse dummy per time period, common to all units.
Total candidates: T indicators.

Interpretation: A retained JIIS indicator at time t means all units
experienced a common shock (e.g. a global recession, a pandemic) at that time.

Collinearity warning: JIIS is collinear with time fixed effects. Do not
use jiis with effect(twoways) or effect(time) - the command
will error out. Use effect(individual) or effect(none) instead.

When to use: Use JIIS when you want to select which time effects are
significant rather than including all time effects mechanically. This is useful
when you have many time periods and most are uninformative.

JSIS - Joint Step Indicator Saturation

What it detects: Common permanent structural breaks affecting all units
simultaneously. This is the "joint" analogue of FESIS: instead of unit-specific
shifts, it tests for breaks common to all units at the same time.

Indicator matrix: One step dummy per time period (from t onward), common to
all units. Total candidates: T-1 indicators.

Interpretation: A retained JSIS indicator at time t means all units
experienced a common permanent level shift starting at t (e.g. a regulatory
change affecting an entire market).

Collinearity note: JSIS indicators are typically absorbed by time fixed effects
when effect(twoways) or effect(time) is used. The command issues a
warning, but does not error out. Consider using effect(individual) if JSIS
is your primary interest.

Fixed Effects Options

The effect() option controls which fixed effects are included in the base
model. The choice interacts with the selection of indicators and affects
collinearity.

effect()

twoways (default) Include both unit and time fixed effects.
The first unit dummy and first time dummy are dropped to avoid collinearity with
the intercept. This is the standard TWFE specification. Use this in most
applications.

individual Include only unit (individual) fixed effects. Use when
time effects are unimportant or you want to test for common time effects via
JIIS.

time Include only time fixed effects.

none No fixed effects. Useful when working with pre-demeaned data
or when fixed effects are not appropriate.

Selection Threshold: t_pval and tlimit

The selection threshold determines how aggressively indicators are retained. Two
equivalent parameters control it:

t_pval(#) specifies a two-sided p-value. The t-limit is computed as
tlimit = invnormal(1 - t_pval/2). Common values:

t_pval(0.001) -> tlimit = 3.291 (strict; R getspanel default)

t_pval(0.01) -> tlimit = 2.576 (moderate; commonly used)

t_pval(0.05) -> tlimit = 1.960 (liberal; more false positives)

tlimit(#) directly specifies the absolute t-statistic threshold. If
specified (> 0), it overrides t_pval.

How to choose? Stricter thresholds (t_pval = 0.001) reduce false positives
but may miss small genuine breaks. Looser thresholds (t_pval = 0.01 or 0.05)
detect more breaks but include more false positives.

Recommendation: Start with the default (0.001) for a conservative analysis.
Then repeat with t_pval(0.01) as a sensitivity check to see whether additional
breaks are detected. Interpret the results jointly.

False Discovery Rate Control

The selection framework guarantees control of the false positive (Type I error)
rate. Under the null hypothesis of no structural break, the probability that an
indicator is spuriously retained converges to:

gamma_c = 2 * (1 - Phi(tlimit))

where Phi() is the standard normal CDF. This is reported after estimation as the
False Discovery Rate (FDR) section.

Key quantities displayed:

gamma_c (eq.36): The per-indicator false positive rate. Equals
t_pval when tlimit is derived from t_pval.

Total candidate indicators: The total number of candidate indicators
generated (depends on N, T, and selected methods).

E[spurious retained] (eq.37): Expected number of false positives =
gamma_c x (total candidates). Compare this to the number of retained indicators
to judge reliability.

P(unit falsely treated) (eq.45): Probability that a unit is falsely
classified as ever-treated = 1 - (1 - gamma_c)^(T-1). With T-1 candidate break
dates per unit, the more periods you have, the higher the chance of at least one
false positive per unit.

Practical guidance: If E[spurious retained] is close to or exceeds the number
of retained indicators, the results may be unreliable. Tighten the threshold.

Algorithm Details

The GETS selection algorithm in xtgets proceeds as follows:

Step 1: Fixed effects generation. Unit and/or time dummy variables
are created using tab, gen(). For effect(twoways), the first unit
dummy and the first time dummy are dropped to ensure identification.

Step 2: Indicator matrix generation. Mata functions construct the
candidate indicator matrices according to the selected saturation methods. The
naming convention is: _fesis_unit_year, _iis_unit_year,
_csis_var_year, etc.

Step 3: Two-stage GETS selection.

Stage 1 (structural indicators): Each FESIS/CSIS/CFESIS/TIS/JSIS
indicator is individually tested against the base model (y = X beta + FE).
Indicators with |t| >= tlimit pass screening. Then all screened indicators
enter a joint regression and are iteratively reduced by backward elimination
until all retain |t| >= tlimit.

Stage 2 (outlier indicators): Each IIS/JIIS indicator is individually
tested against the base model augmented with retained structural indicators.
Screened indicators are then jointly refined as in Stage 1.

Step 4: Final model. The final regression includes regressors,
fixed effects, and all retained indicators. Standard OLS output is displayed,
followed by a formatted table of detected breaks with significance stars.

Interpreting Results

After estimation, xtgets displays:

1. Standard regression output: The full OLS table with all regressors, fixed
effects, and retained indicators. The coefficients on the regressors (e.g. lgdp,
lpop) are the estimated effects conditional on the detected structural breaks.
These are typically more reliable than uncorrected estimates because structural
breaks have been absorbed by the retained indicators.

2. Detected Structural Breaks table: A summary listing each retained
indicator with its coefficient, standard error, t-statistic, p-value, and
significance stars (*** < 0.001, ** < 0.01, * < 0.05, . < 0.10).

3. Diagnostics: SE of regression, R-squared, log-likelihood, and the
False Discovery Rate table.

Naming convention for retained indicators:

Name Meaning

fesisI.Y Unit I had a step-shift from year Y
iisI.Y Unit I had an outlier at year Y
csis.X.Y Slope of X changed at year Y (all units)
cfesis.X.I.Y Slope of X changed for unit I at Y
tisI.Y Unit I had a trend break from Y
jsis.Y Common step-shift at year Y (all units)
jiis.Y Common impulse at year Y (all units)

Choosing the Right Method

The following decision guide helps you select the appropriate indicator saturation
method for your research question:

Question 1: Do you suspect permanent level shifts for individual units?

Yes -> Use fesis. This is the workhorse method for detecting
unknown treatment effects in a diff-in-diff framework.

Question 2: Do you suspect the effect of a regressor changed over time?

Yes, common to all units -> Use csis.

Yes, unit-specific -> Use cfesis.

Question 3: Do you suspect outliers or one-time shocks?

Unit-specific -> Use iis.

Common to all -> Use jiis (requires no time FE).

Question 4: Do you suspect gradual (trend) treatment effects?

Yes -> Use tis.

Question 5: Do you suspect a common structural break for all units?

Yes -> Use jsis (works best without time FE).

Recommended workflow:

1. Start with fesis alone using the default threshold. This
provides a baseline analysis of unit-specific level shifts.

2. Add iis to control for outliers: fesis iis. Compare
results. If some FESIS indicators disappear, they may have been driven by
outliers rather than genuine breaks.

3. If theory suggests coefficient instability, add csis or
cfesis.

4. Conduct sensitivity analysis by varying t_pval (0.001, 0.01, 0.05)
and comparing which breaks are robust across thresholds.

Requirements

Stata version: Stata 15.1 or later.

Required setup: xtset panelvar timevar must be called before
xtgets. The data must be panel data with a valid panel variable (the unit
identifier) and a valid time variable.

Balanced vs unbalanced panels: xtgets works with both balanced and
unbalanced panels. However, balanced panels are recommended for FESIS and TIS
because unbalanced panels may create partially collinear indicators.

Sample size: The number of candidate indicators grows rapidly with N and T.
With large panels, computation may be slow. Consider restricting analysis to
subsets using fesis_id(), csis_var(), etc.

Collinearity constraints:

- JIIS cannot be used with effect(twoways) or effect(time)
because JIIS indicators are collinear with time dummies.

- JSIS is typically not retained with time fixed effects for the same
reason.

Examples

Example 1: Basic FESIS (detecting unit-specific level shifts)

This is the simplest and most common use case. The command tests whether any
unit experienced a permanent change in its intercept:

. xtset country year

. xtgets emissions lgdp lpop, fesis effect(twoways)

This uses the default t_pval = 0.001 (=tlimit 3.291), which is very strict.
Only highly significant breaks will be retained.

Example 2: FESIS with moderate significance (t.pval = 0.01)

A slightly looser threshold to detect more breaks:

. xtgets emissions lgdp lpop, fesis effect(twoways) t_pval(0.01)

Example 3: Combined FESIS + IIS (two-stage selection)

This adds outlier detection. Structural breaks (FESIS) are found first,
then outliers (IIS) are detected conditional on the breaks. This prevents
outliers from masking genuine structural shifts:

. xtgets emissions lgdp lpop, fesis iis effect(twoways) t_pval(0.01)

Example 4: Coefficient stability testing (CSIS)

Test whether the effect of GDP on emissions changed over time for all
countries:

. xtgets emissions lgdp lpop, csis csis_var(lgdp) effect(twoways) t_pval(0.01)

Example 5: Unit-specific coefficient change (CFESIS)

Test whether individual countries experienced different changes in the
GDP effect:

. xtgets y x1 x2, cfesis cfesis_var(x1) effect(twoways)

Example 6: Trend indicator saturation (TIS)

Detect gradual (linear trend) treatment effects:

. xtgets y x1 x2, tis effect(twoways) tlimit(2.5)

Example 7: Kitchen-sink approach with verbose output

Use multiple methods simultaneously with detailed output:

. xtgets y x1 x2, fesis iis csis csis_var(x1) effect(twoways) t_pval(0.01) verbose

Example 8: Restricting FESIS to specific units

Test only specific countries for structural breaks (saves computation):

. xtgets y x1 x2, fesis fesis_id(1 2 3) effect(twoways)

Example 9: Using weights and alternative variance estimators

. xtgets y x1 x2 [pw=w], fesis effect(twoways) vce(robust)

Postestimation: Visualizations (xtgets_plot)

After running xtgets, use xtgets_plot for visualizations that replicate
the R getspanel package plotting functions.

Syntax:

xtgets_plot [, type(string) saving(filename)
scheme(schemename) title(string)]

type(breaks) - Break Detection Timeline

Scatter plot showing the timing of detected breaks by unit. Each dot represents
a retained indicator. Different marker shapes and colours distinguish indicator
types (FESIS = circle, IIS = diamond, CSIS = triangle, TIS = square).

R equivalent: plot(is1)

. xtgets_plot, type(breaks)

. xtgets_plot, type(breaks) saving(mybreaks)

type(heatmap) - Effect Heatmap

Heatmap showing the effect magnitude (coefficient) of retained indicators over
time for each unit. Blue shades indicate positive effects; red shades indicate
negative effects. Darker colours represent larger magnitudes. For FESIS, the
effect extends from the break date to the end of the sample.

R equivalent: plot(is1) (heatmap view)

. xtgets_plot, type(heatmap)

type(grid) - Fitted vs Actual Grid

A grid of small-multiple line plots, one per unit. Each panel shows:

Black line with + markers: Actual values of the dependent variable.

Blue line: Fitted values from the final model (including retained indicators).

Red vertical lines: Dates of detected breaks.

This plot helps visually assess model fit and whether breaks align with visible
changes in the data.

R equivalent: plot_grid(is1)

. xtgets_plot, type(grid) saving(mygrid)

type(counter) - Counterfactual Analysis

For each unit that experienced a detected break, shows the actual vs counterfactual
(predicted values without break indicators) trajectories. The shaded area between
them represents the estimated treatment effect.

Black line with + markers: Actual values.

Red dashed line: Counterfactual (what would have happened without the break).

Blue line: Fitted values (with breaks).

Red shaded area: Difference = estimated treatment effect.

R equivalent: plot_counterfactual(is1)

. xtgets_plot, type(counter)

type(residuals) - Residual Analysis

Grid of residual plots by unit. Shows residuals from the final model (including
retained indicators). Well-behaved residuals should be centred around zero with
no visible patterns.

R equivalent: plot_residuals(is1)

. xtgets_plot, type(residuals)

Stored Results

xtgets stores the following in e():

Scalars

e(n_indicators) Total number of candidate indicators generated

e(n_retained) Number of retained (significant) indicators

e(tlimit) Absolute t-statistic threshold used for selection

e(t_pval) Two-sided p-value corresponding to tlimit

e(gamma_c) Per-indicator false positive rate = 2*(1-Phi(tlimit))

e(N_units) Number of panel units (N)

e(T_periods) Number of time periods (T)

Macros

e(cmd) xtgets

e(effect) Fixed effects specification used

e(depvar) Name of the dependent variable

e(xvars) Names of the regressors

e(ivar) Panel (unit) variable name

e(tvar) Time variable name

e(retained) Space-separated list of retained indicator variable names

e(fesis) "yes" if FESIS method was activated

e(iis) "yes" if IIS method was activated

e(csis) "yes" if CSIS method was activated

e(cfesis) "yes" if CFESIS method was activated

e(tis) "yes" if TIS method was activated

e(jiis) "yes" if JIIS method was activated

e(jsis) "yes" if JSIS method was activated

Matrices

e(b) Coefficient vector from the final regression

e(V) Variance-covariance matrix from the final regression

Accessing retained indicators programmatically:

. local breaks `e(retained)'

. foreach b of local breaks {

. di "`b': " _b[`b']

. }

Mathematical Background

The base panel model estimated by xtgets is:

y_it = alpha_i + gamma_t + X_it * beta + Z_it * delta + u_it

where:

- y_it is the dependent variable for unit i at time t

- alpha_i are unit fixed effects

- gamma_t are time fixed effects

- X_it are the specified regressors

- Z_it are the retained indicator variables (selected by GETS)

- u_it is the error term

The indicator matrix Z contains only the indicators that survived the GETS
selection procedure. Under the null that Z_it = 0 for all i,t (no breaks),
the probability of spuriously retaining indicator k is:

P(|t_k| > c) = 2 * (1 - Phi(c)) = gamma_c

For m total candidate indicators, the expected number of false positives is
m * gamma_c. This is the gauge of the test. Pretis and Schwarz (2022, eq. 37)
show that this provides asymptotic control analogous to Bonferroni-type corrections
but with higher power due to the sequential elimination procedure.

Theorem 1 (Pretis and Schwarz 2022): In a TWFE model, FESIS-saturated panel
GETS nests the standard staggered DID estimator. If treatment is a clean
step-shift, the FESIS coefficient exactly equals the ATT.

References

Pretis, F. and Schwarz, M. (2022/2026). Discovering What Mattered: Detecting Unknown
Treatment as Breaks in Panel Models.
Available at SSRN: https://ssrn.com/abstract=4022745.

Schwarz, M. and Pretis, F. (2026). getspanel: General-to-Specific Modelling of
Panel Data. R package version 0.2.1.
CRAN.

Castle, J.L., Doornik, J.A. and Hendry, D.F. (2015). Detecting Location Shifts
during Model Selection by Step-Indicator Saturation.
Econometrics 3(2): 240-264.

Castle, J.L., Doornik, J.A. and Hendry, D.F. (2025). Trend-Indicator Saturation.
Oxford Bulletin of Economics and Statistics.

Clarke, D.C. (2013). gets: General to Specific algorithm for model selection.
Stata package, University of Oxford.

Hendry, D.F., Johansen, S. and Santos, C. (2008). Automatic Selection of
Indicators in a Fully Saturated Regression. Computational Statistics 23: 317-335.

Johansen, S. and Nielsen, B. (2009). An Analysis of the Indicator Saturation
Estimator as a Robust Regression Estimator. In Castle, J.L. and Shephard, N. (eds.)
The Methodology and Practice of Econometrics. Oxford University Press.

Koch, N., Naumann, L., Pretis, F., Schwarz, M. and zu Ermgassen, S. (2022).
Attributing agnostically detected large reductions in road CO2 emissions to
policy mixes. Nature Energy 7: 844-853.

Wooldridge, J.M. (2025). Two-Way Fixed Effects, the Two-Way Mundlak Regression,
and Difference-in-Differences Estimators. Econometric Review.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

Also see

xtreg, regress, xtset