*! xtflucbreak 1.0.0 07aug2026

Title

xtflucbreak postestimation -- testing the model in memory for a structural change

Syntax

xtflucbreak [if] [in] [, options]

That is, xtflucbreak with no varlist. All the options documented in
xtflucbreak remain available.

Description

Applied panel work usually fits a model first and asks about parameter stability second.
Called with no varlist, xtflucbreak recovers the dependent variable, the regressors
and the estimation sample from the results in memory and runs the fluctuation test of
Li, Xiao and Chen (2024) on exactly that specification.

The test is not a test of the fitted estimator. It always re-fits per-panel OLS,
because that is the estimator whose recursive path the statistic is built on. What is
inherited from e() is the specification and the sample, not the
coefficients. This matters for interpretation: after xtreg, fe the test asks whether
the heterogeneous slopes of that same y on that same X are stable, not whether the
fixed-effects estimate is.

Supported estimators

Command

regress pooled OLS

areg absorbed OLS

xtreg FE, RE, BE, MLE

xtgls panel GLS

reghdfe multi-way fixed effects

xtmg Eberhardt's mean-group, CCE-MG and AMG

xtcce Neal's CCE estimators

xtdcce2 Ditzen's dynamic CCE

xtfmg fully modified mean group

xtpmg pooled mean group

xtbfkbreak Baltagi-Feng-Kao heterogeneous panels with breaks

Anything else exits with r(301) and a message naming the supported set. There is no
silent fallback: guessing a specification from an unrecognised e(b) is how wrong
answers get produced quietly.

What is read from e()

Dependent variable from e(depvar). If that macro holds more than one word it is
reduced to its last token and confirmed to be a variable -- xtmg with
augment impose stores it as the two-word string "adjusted y", which would
otherwise be passed on verbatim.

Regressors, in this order of preference: e(indepvars), e(indepvar),
e(rhs), then the column names of e(b). In the last case equation prefixes
(eq:var) are stripped, _cons and the dependent variable are dropped, names
that are not variables in the current dataset are dropped, and duplicates are removed.
e(endog) is appended when present, so an instrumented regressor is still tested for
a break in its slope.

Sample from e(sample). The test sample is the intersection of e(sample),
any if/in you add, and non-missingness on all variables. The balance
requirement is then checked on that sample -- an estimator that dropped a singleton
panel can leave the remainder unbalanced, and the command will say so.

Nothing is written. xtflucbreak is rclass and never calls an estimation
command internally, so your e() survives the call untouched. You can run it between
an estimation command and its own postestimation commands without estimates store.

Automatic branch selection

If the fitted model already controls for unobserved common factors, the CCE branch
(section 4) is selected automatically and the header says so. The rule is:

xtdcce2, xtcce, xtfmg always CCE

everything else CCE if any of e(title2), e(model),
e(estimator), e(transform), e(title), e(cmdline) or
e(properties) contains "cce", "common correlated", "amg" or "augmented mean
group"

Several macros are scanned because estimators disagree about where they record the
variant. xtmg (version 1.0.1) does not set e(cmdline) at all -- it flags
the variant in e(title2) as CCEMG, AMG or MG. Checking only
e(cmdline) silently left xtmg, cce on the section-3 branch.

AMG also triggers the CCE branch: the augmented mean-group estimator presupposes a
common factor, so testing its specification without controlling for one would be
inconsistent. Note that xtflucbreak builds its own Mw in every case; it does
not reuse AMG's common dynamic process.

Specifying cce explicitly always forces the CCE branch. There is no way to force the
section-3 branch after a CCE estimator other than supplying the varlist by hand -- which is
deliberate, since that combination is almost always a mistake.

Note that xtflucbreak builds its own Mw from the cross-section averages of
(y, X); it does not reuse whatever augmentation the fitted command used. If you fitted
xtdcce2 with extra cross-sectional averages or lags, add the matching
ccalags() yourself.

Guarantees and caveats

Guaranteed. e() is not modified. The estimation sample is respected. The panel
must still be xtset and balanced on that sample.

Fixed effects are not inherited. After xtreg, fe or areg, the absorbed
effects are not carried over -- the test runs per-panel OLS on the levels, and each
panel's own intercept is estimated as part of {&beta}i (unless noconstant is
specified). This is the right thing to do: a panel-specific intercept is exactly what the
heterogeneous model of Li, Xiao and Chen already allows, and it is one of the coefficients
whose stability is being tested.

Factor variables and time-series operators. The recovered regressor list is expanded
to plain variable names. If your model used i. or L. notation, create the
variables explicitly and pass a varlist rather than relying on postestimation mode.

Weights are ignored. The statistic has no weighted version in the paper.

After xtbfkbreak. Running the test after a model that already imposes a
break is a specification check, not a fresh test: you are asking whether the residual
specification still shows instability. Read a rejection there as evidence of a second
break or of a misplaced first one.

Examples

Fit, then test

. webuse grunfeld, clear

. xtset company year

. xtreg invest mvalue kstock, fe

. xtflucbreak

The fitted model is untouched, so its own postestimation still works

. estat vce

Options work exactly as in the standalone form

. xtflucbreak, graph level(1) showunits

After a CCE estimator the CCE branch is selected automatically

. xtmg invest mvalue kstock, cce

. xtflucbreak

The recommended sequence: test for a break, then estimate the regimes

. xtmg invest mvalue kstock, cce

. xtflucbreak, graph

. xtbfkbreak invest mvalue kstock, breaks(1)

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane

Also see

Online: xtflucbreak,
xtflucbreak methods,
xtbfkbreak, xtreg