*! version 1.0.0 09jul2026

Title

xtkpybreak cce -- Common Correlated Effects estimation valid under
non-stationary (I(1)) common factors (Kapetanios, Pesaran & Yamagata 2011)

Syntax

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

Main
proxy(yx|x) factor proxy: cross-section averages of
(depvar,indepvars) (yx, the KPY/Pesaran default) or of the
regressors only (x, the BFW proxy)

estimator(mg|pooled) which estimator to post in e(b);
default mg (CCEMG). Both CCEMG and CCEP are always displayed and stored

noconstant drop the intercept from the factor-proxy block, so the
proxy is the cross-section averages alone (strict Pesaran/BFW proxy)

level(#) confidence level for the reported interval; default
level(95)

Graphs
coefplot plot the heterogeneous per-panel slopes b(i) of the
first regressor with the CCEMG line and confidence band

factorplot plot the cross-section-average factor proxies over
time

name(stub) name stub for the saved graphs (default xtkpb)

Description

xtkpybreak cce estimates the mean slope in a heterogeneous panel with an
unobserved multifactor error structure, allowing the factors to be I(1).
Following Pesaran (2006) and Kapetanios, Pesaran & Yamagata (2011), the
unobserved factors are proxied by cross-section averages of the observables,
which are added to each unit's regression. The command reports:

o CCEMG - the Common Correlated Effects Mean-Group
estimator (KPY eq. 14), a simple average of the per-unit CCE estimators, with
standard errors from the cross-panel dispersion (KPY eq. 38);

o CCEP - the Common Correlated Effects Pooled estimator
(KPY eq. 20), with the sandwich variance of KPY eqs 42-44.

A key result of KPY is that these estimators and, crucially, their variance
estimators are the same as in the stationary case: no Brownian-motion
functionals or re-tabulated critical values are needed. The procedure is valid
for any fixed number of factors and does not require estimating that number.

Requirements. The data must be xtset and the panel must be
balanced. Time-series operators (e.g. L., D.) are allowed in
indepvars.

Options

proxy(yx|x) selects the cross-section averages used to proxy the
unobserved factors. yx (default) uses the averages of the dependent
variable and the regressors, as in Pesaran (2006) and KPY. x uses the
averages of the regressors only, as in the simplification adopted by Baltagi,
Feng & Wang (2025); with x, whether the factor loadings are correlated with
the regressor loadings does not affect the rank condition.

estimator(mg|pooled) chooses which estimator is posted in e(b)/e(V)
for downstream test/coefplot use. Both estimators are always
displayed and are stored in e(b_mg), e(b_pooled), etc.

noconstant removes the intercept from the projection block, so the
unobserved factors are proxied by the cross-section averages only. By
default an intercept (the KPY deterministic D term) is included in the
proxy block. Use noconstant for the strict Pesaran (2006) / BFW (2025)
eq. (9) proxy without a separate constant.

level(#) sets the confidence level for the interval printed in the table.

coefplot produces a caterpillar-style scatter of the per-panel slope
estimates b(i) for the first regressor, with the CCEMG estimate drawn as a
reference line and its level% band as dashed lines - a quick view
of slope heterogeneity.

factorplot plots the cross-section-average series that proxy the
unobserved I(1) factors, over the time dimension.

name(stub) sets the stub for saved graph names: stub_coef and
stub_factor.

Stored results

xtkpybreak cce stores the following in e():

Scalars

e(N) number of observations

e(N_g) number of panels (N)

e(Tbar) time periods per panel (T)

e(k) number of regressors

Macros

e(cmd) xtkpybreak

e(subcmd) cce

e(estimator) posted estimator (mg or pooled)

e(proxy) yx or x

e(depvar) dependent variable

e(indepvars) regressors

Matrices

e(b), e(V) posted estimator and its variance

e(b_mg), e(se_mg), e(V_mg) CCEMG estimates

e(b_pooled), e(se_pooled), e(V_pooled) CCEP estimates

e(b_i) k x N matrix of per-panel CCE slopes

e(se_i) k x N matrix of per-panel standard errors (KPY eq. 49-50)

Remarks and interpretation

Why CCE here. When the errors share unobserved common factors, ignoring
them (a "naive" pooled or mean-group regression) gives inconsistent slopes and
badly sized tests. CCE augments each unit's regression with cross-section
averages, which span the factor space, and remains valid even when the factors
are I(1) (KPY 2011) - with the same formulas as the stationary case,
so no unit-root pre-testing or Brownian-motion critical values are needed.

MG vs pooled. The CCEMG estimator averages the per-unit slopes and is robust
to slope heterogeneity; the CCEP estimator pools and is more efficient when the
slopes are (near) homogeneous. Both are always displayed; pick which one lands in
e(b) with estimator(). The per-unit slopes are in e(b_i) and
can be plotted with coefplot.

Rate. Individual slopes converge at root-T (not T) even though y and x are
I(1) and cointegrated, because after projecting off the factors the working
series are stationary (KPY Remark 6). The mean of the slopes converges at root-N.

Examples

Setup

. webuse grunfeld, clear

. xtset company year

Default CCE (both CCEMG and CCEP reported)

. xtkpybreak cce invest mvalue kstock

Regressor-only proxy; post the pooled estimator

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

Strict Pesaran/BFW proxy without an intercept in the proxy block

. xtkpybreak cce invest mvalue kstock, noconstant

Slope-heterogeneity and factor-proxy graphs

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

Postestimation: Wald test and cross-model comparison

. xtkpybreak cce invest mvalue kstock

. test mvalue kstock

. estimates store CCEMG

. matrix list e(b_i)

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane