*! version 1.0.0 2026-05-12

Title

xtbestcce -- Bootstrap-Enhanced Common Correlated Effects for panel
data with distinct correlated factors

Syntax

xtbestcce depvar indepvars [if] [in]
[, options]

Estimator
pooled CCEP estimator (pooled — eq. 2.4) default

mg CCEMG estimator (mean-group — eq. 2.5)

fe include a column of ones in the cross-section averages
(equivalent to two-way fixed effects)

noconstant suppress the intercept in the regression

Cross-section averages
crosssectional(varlist) variables whose CAs are used to proxy
the factors. Default: depvar indepvars.

noybar exclude the depvar mean from the CAs (recommended under
distinct factors, see paper p.2).

ic select the subset of CAs that minimises the Information
Criterion of eq. (3.1) — Margaritella-Westerlund / De Vos-Stauskas.

ic_penalty(string) penalty for the IC. Choices: log
(default; (N+T)/NT * log(min(N,T)^2)), sqrt, nt.

Inference (Algorithm 1 — CS bootstrap)
bootstrap use the cross-section bootstrap of Algorithm 1 with
percentile CIs from eq. (2.8).

reps(#) number of bootstrap replications (default 999;
min 99).

seed(#) seed for reproducibility.

level(#) confidence level (default level()).

bsave(name) save the B x k bootstrap draws as a matrix.

Display
nice use the colourful table (boxed SMCL).

notable suppress the table.

plot coefficient plot with CIs.

bootplot bootstrap-distribution panel (requires bootstrap).

trace print bootstrap progress.

Description

xtbestcce implements the toolbox of
Stauskas & De Vos (2024),
which extends the Common Correlated Effects (CCE) framework of
xtdcce2 (Ditzen, 2024) to settings where the dependent variable
and the regressors are driven by distinct but correlated sets of unobserved
factors.

The model is the multi-factor panel regression

y_it = β' x_it + γ_i' f_ + ε_it, x_it = Γ_i' f_ + v_it

with cov(f_y, f_x) ≠ 0 and m_y ≥ 1. Pesaran's (2006) original CCE estimator
breaks down when m_y > 1 because the cross-section average ȳ can no longer
identify m_y factors. xtbestcce solves this in three ways:

1. Estimates β by CCEP or CCEMG using cross-section averages of the
explanatory variables only (or any selected subset), see eq. (2.4)-(2.5).

2. Selects the optimal subset of CAs through the Information Criterion of
eq. (3.1)-(3.2), which guarantees m_x = g asymptotically and restores
asymptotic normality (Theorems 1-2).

3. Performs inference via the Cross-Section bootstrap (Algorithm 1), which
replicates the non-standard bias h_2 and the variance component Ψ_f that the
analytical variance cannot identify (Theorems 2, 6).

Under heterogeneous slopes (CCEMG and CCEP with Theorem 3),
the estimators are √N-consistent and asymptotically normal regardless of
whether m_x = g or m_x < g; the user therefore need not discriminate
between the homogeneous and heterogeneous cases.

Options

pooled / mg – Estimator choice. pooled fits the CCEP
estimator of equation (2.4):

β̂_CCEP = ( Σ_i X_i' M_F̂x X_i )^{-1} Σ_i X_i' M_F̂x y_i

while mg fits the CCEMG estimator of equation (2.5):

β̂_CCEMG = (1/N) Σ_i ( X_i' M_F̂x X_i )^{-1} X_i' M_F̂x y_i

fe – Adds a column of ones to F̂_x, which makes the routine
invariant to individual fixed effects (paper Section 2.1).

crosssectional(varlist) – The pool of variables whose cross-section
averages are candidates for F̂_x. With ic the IC selector picks the
optimal subset.

ic – Activates the Information Criterion selector (paper
Section 3.1). It enumerates every non-empty subset of the candidate CAs of size
≥ k and keeps the one minimising

IC(M_x) = log( det(Q̄_x̌) ) + g · k · p_NT

with Q̄_x̌ = (1/N) Σ T^{-1} X_i' M_ X_i and p_NT determined by
ic_penalty(). This is the practical implementation of eq. (3.1)-(3.2).

bootstrap – Activates the cross-section bootstrap of
Algorithm 1. For each of reps() replications the routine draws N units
with replacement, rebuilds the CAs in the bootstrap world, and re-estimates β.
The reported standard errors are the bootstrap-percentile sample standard
deviations and confidence intervals follow eq. (2.8).

plot / bootplot – Two graph styles. plot produces a
coefficient/CI dotplot; bootplot produces a multi-panel density plot of
the bootstrap distribution per coefficient.

Examples

Setup: use a panel and xtset it.

. webuse grunfeld, clear

. xtset company year

Plain CCEP (no bootstrap):

. xtbestcce invest mvalue kstock, pooled fe

Heterogeneous-slope CCEMG with IC-selected CAs:

. xtbestcce invest mvalue kstock, mg ic crosssectional(invest mvalue kstock)

Full toolbox (Stauskas-De Vos): CCEP + IC + CS bootstrap + nice table:

. xtbestcce invest mvalue kstock, pooled fe ic bootstrap reps(999) seed(42) nice

Coefficient plot and bootstrap density:

. xtbestcce invest mvalue kstock, mg ic bootstrap reps(999) seed(42)

. xtbestcce_plot, kind(coef)

. xtbestcce_plot, kind(bdist)

IC information after fit:

. xtbestcce_plot, kind(ic)

Stored results

Scalars:

e(N) number of NT observations

e(N_g) number of panels (N)

e(T) number of time periods

e(k) number of regressors

e(g_ca) number of cross-section averages used (g)

e(ic_used) 1 if IC selection was active

e(fe) 1 if fixed-effect column added

e(bootstrap) 1 if CS bootstrap was used

e(reps) bootstrap replications

e(level) CI level

Macros:

e(cmd) xtbestcce

e(estimator) ccep or ccemg

e(depvar) name of dependent variable

e(indepvars) list of regressors

e(Fxnames) cross-section averages used as factor proxy

e(ic_pen) IC penalty kind

Matrices:

e(b) coefficient vector

e(V) variance estimator (bootstrap if requested,
analytical eq. 2.6/2.7 otherwise)

e(V_boot) CS bootstrap variance (only with bootstrap)

e(bsamples) B x k matrix of bootstrap draws (only with
bootstrap)

e(selector) indices of CAs selected by the IC

References

Stauskas, O. and De Vos, I. (2024). Handling Distinct Correlated Effects with
CCE. MPRA Paper No. 120194.
https://mpra.ub.uni-muenchen.de/120194/.

De Vos, I. and Stauskas, O. (2024). Cross-section bootstrap for CCE
regressions. Journal of Econometrics, 240(1):105648.

Pesaran, M.H. (2006). Estimation and inference in large heterogeneous panels
with a multifactor error structure. Econometrica, 74(4):967-1012.

Margaritella, L. and Westerlund, J. (2023). Using information criteria to
select averages in CCE. The Econometrics Journal, utad009.

Cui, G., Norkutė, M., Sarafidis, V. and Yamagata, T. (2022). Two-stage
instrumental variable estimation of linear panel data models with interactive
effects. The Econometrics Journal, 25(2):340-361.

Ditzen, J. (2024). xtdcce2 — Stata module to estimate heterogeneous coefficient
panel data models with cross-sectional dependence.

Author

Dr. Merwan Roudane

merwanroudane920@gmail.com

Bug reports and feature requests are welcome by email. Please cite the package
as:

Roudane, M. (2026). xtbestcce: Bootstrap-Enhanced CCE for distinct
correlated factors. Stata package, version 1.0.0.