*! version 1.0.0 09jul2026

Title

xtkpybreak -- CCE estimation under non-stationary common factors and
multiple structural breaks in non-stationary heterogeneous panels

Syntax

Common Correlated Effects (Kapetanios, Pesaran & Yamagata 2011)

xtkpybreak cce depvar indepvars [if] [in]
[, cce_options]

Multiple structural breaks (Baltagi, Feng & Wang 2025)

xtkpybreak break depvar indepvars [if] [in]
, nbreaks(#) [break_options]

The data must be xtset as a balanced panel before use.
xtkpybreak is an estimation command: it posts e(b) and
e(V), so test, lincom, estimates and
coefplot all work afterwards. See
xtkpybreak cce and
xtkpybreak break for the full option lists.

Description

xtkpybreak implements two closely related methodologies for
non-stationary heterogeneous panels in which cross-sectional dependence is
generated by a small number of unobserved common factors that may follow
unit-root (I(1)) processes:

1. CCE under I(1) factors - Kapetanios, Pesaran & Yamagata (2011,
Journal of Econometrics) show that Pesaran's (2006) Common Correlated
Effects idea - proxy the unobserved factors by cross-section averages of
the observables and add them as regressors - remains valid when the
factors are I(1). The Common Correlated Effects Mean-Group (CCEMG) and Pooled
(CCEP) estimators of the mean slope have the same limiting form and the
same variance estimators as in the stationary case. Use
xtkpybreak cce.

2. Multiple structural breaks - Baltagi, Feng & Wang (2025,
Econometric Reviews) build on KPY: because the factor proxy survives I(1)
factors, unobserved factors can be treated as extra regressors, and breaks in
slopes and in error-factor loadings become ordinary breaks in a linear
regression. Break points are estimated jointly by least squares using the
Bai & Perron (1998, 2003) dynamic-programming algorithm; the regime slopes are
then estimated by (partitioned) CCE. Use
xtkpybreak break.

Subcommands

subcommand

cce CCEMG and CCEP estimators, robust to I(1)
common factors (KPY 2011)

break least-squares estimation of m
structural breaks in slopes (and optionally in error-factor loadings), with
regime-specific CCE mean-group slopes (BFW 2025)

Methods and formulas

For panel unit i = 1,...,N over t = 1,...,T the model is

y(it) = x(it)'b(i) + g(i)'f(t) + e(it),

where f(t) is a q-vector of unobserved common factors following I(1)
processes, x(it) = G(i)'f(t) + v(it), and the object of interest is the mean
slope b = E[b(i)]. The unobserved factors are proxied by cross-section averages
of the observables (option proxy()); with the rank condition satisfied,
these averages consistently span the factor space even when f(t) is I(1)
(KPY Theorem, BFW eqs 7-8).

CCE. b(i) = (X(i)'M X(i))^-1 X(i)'M y(i), where M projects off the
proxy matrix. CCEMG is the simple average of b(i) with variance from the
cross-panel dispersion (KPY eq. 38); CCEP is the pooled estimator with variance
from KPY eqs 42-44.

Breaks. With slope breaks only (BFW model 4) the proxy is partialled out
globally and the transformed regression y~ = X~ b(i) has breaks estimated by
minimizing the panel sum of squared residuals over all admissible partitions
(BFW eq. 13). With breaks in loadings too (model 5) the augmented regressor
z(it) = (x(it), proxy(t)) is used and all its coefficients break. The
dynamic-programming solution (Bai & Perron 2003) returns the global optimum.
Regime slopes are the (partitioned) mean-group estimates; break dates are
super-consistent as N grows.

Stored results

Both subcommands are e()-class. e(b) / e(V) hold the posted
estimator (CCEMG by default for cce; the stacked regime mean-group slopes
for break). See each subcommand's help for the complete list, including
e(b_mg), e(b_pooled), e(b_i) (cce) and e(breakdates),
e(b_regime) (break).

Examples

Setup - any balanced panel xtset by panel and time.
The Grunfeld data (10 firms, 20 years) ships with Stata:

. webuse grunfeld, clear

. xtset company year

1. CCE estimation (mean slope, robust to I(1) common factors)

. xtkpybreak cce invest mvalue kstock

Use the regressor-only proxy and post the pooled estimator in e(b):

. xtkpybreak cce invest mvalue kstock, proxy(x) estimator(pooled)

Add the two diagnostic graphs (slope heterogeneity; factor proxies):

. xtkpybreak cce invest mvalue kstock, coefplot factorplot name(g)

Wald test and stored comparison, exactly as after any estimation command:

. test mvalue kstock

. estimates store CCE

2. One structural break in the slopes, with journal-style plots:

. xtkpybreak break invest mvalue kstock, nbreaks(1) breakplot coefevolution

. matrix list e(breakdates)

Test whether a slope actually changed across the break (regimes r1,r2):

. test [r1]mvalue = [r2]mvalue

3. Two breaks in slopes and loadings (BFW model 5):

. xtkpybreak break invest mvalue kstock, nbreaks(2) loadings trim(0.15)

4. Full BFW inference set - individual Newey-West s.e. and the
strict eq. (9) proxy with no intercept:

. xtkpybreak break invest mvalue kstock, nbreaks(1) hac(2)

. matrix list e(se_i)

. xtkpybreak break invest mvalue kstock, nbreaks(1) noconstant

5. Dashboard - combine the four graphs into one figure:

. xtkpybreak cce invest mvalue kstock, coefplot factorplot name(a)

. xtkpybreak break invest mvalue kstock, nbreaks(1) breakplot coefevolution name(b)

. graph combine a_coef a_factor b_break b_evo, cols(2)

See xtkpybreak cce,
xtkpybreak break,
xtkpybreak postestimation and the shipped
xtkpybreak_example.do for a fuller, replicable walk-through (real data plus a
simulated design with known break dates and slopes).

References

Bai, J. and P. Perron. 1998. Estimating and testing linear models with multiple
structural changes. Econometrica 66(1): 47-78.
doi:10.2307/2998540

Bai, J. and P. Perron. 2003. Computation and analysis of multiple structural
change models. Journal of Applied Econometrics 18(1): 1-22.
doi:10.1002/jae.659

Baltagi, B. H., Q. Feng, and W. Wang. 2025. Nonstationary heterogeneous panels
with multiple structural changes. Econometric Reviews.
doi:10.1080/07474938.2025.2480626

Kapetanios, G., M. H. Pesaran, and T. Yamagata. 2011. Panels with non-stationary
multifactor error structures. Journal of Econometrics 160(2): 326-348.
doi:10.1016/j.jeconom.2010.10.001

Pesaran, M. H. 2006. Estimation and inference in large heterogeneous panels with
a multifactor error structure. Econometrica 74(4): 967-1012.
doi:10.1111/j.1468-0262.2006.00692.x

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane