*! version 1.0.0 03jul2026

Title

xtfmg map -- cross-sectional dependence diagnostics and
regime-map estimator recommendation

Syntax

xtfmg map depvar indepvars [if] [in]

Description

xtfmg map runs the Mean Group regressions, computes from their
residuals the Pesaran CD statistic and the Bailey-Kapetanios-Pesaran (2016)
exponent of cross-sectional dependence alpha (simple estimator on
standardized residuals), classifies the panel's dependence regime, and
prints the regime map of Guliyev (2026) together with the recommended
estimator:

o weak dependence (alpha < 0.5): with very small N
(< 10), F-SURMG gives the best-calibrated inference; otherwise F-CCEMG is
already the most accurate.

o moderate dependence (0.5 <= alpha < 0.85): F-CCEMG
attains the lowest RMSE at every sample size and near-nominal coverage once
N >= 10. This is the regime of the paper's G7 application
(alpha = 0.732).

o strong dependence (alpha >= 0.85): non-filtering
estimators fail; with large N, plain CCEMG is fully competitive and F-CCEMG
adds an accuracy refinement.

If alpha cannot be estimated, the classification falls back on the CD test:
a CD p-value above 0.05 is classified as weak dependence.

The classification thresholds are working conventions consistent with the
discussion in Bailey, Kapetanios and Pesaran (2016) and the simulation
regimes of Guliyev (2026); they are a guide, not a formal test.

Stored results

Scalars

r(N), r(Tbar), r(n) panel dimensions

r(cd), r(cd_p) Pesaran CD statistic and p-value

r(alpha) CSD exponent

Macros

r(regime) weak, moderate or strong

r(recommend) recommended estimator

Examples

. webuse grunfeld, clear

. xtset company year

. xtfmg map invest mvalue kstock

. di "`r(recommend)'"

References

Bailey, N., G. Kapetanios, and M. H. Pesaran. 2016. Exponent of
cross-sectional dependence: Estimation and inference.
Journal of Applied Econometrics 31: 929-960.

Guliyev, H. 2026. Second-generation heterogeneous panel data model
with individual and common shocks. arXiv:2606.29063.

Author

Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane