*! version 1.0.0 22may2026
help xtmulticointgrat (Stata)

Title

xtmulticointgrat -- Panel multicointegration testing with cross-section
independence or approximate common factors

Package contents

The xtmulticointgrat library implements the panel multicointegration
test of Berenguer-Rico & Carrion-i-Silvestre (2006), Oxford Bulletin of
Economics and Statistics 68 (Supplement), 721-744. Components:

xtmulticointgrat -- main: estimation and
testing for panel multicointegration.

xtmulticointgrat_graph -- publication-quality diagnostic graphs.

Syntax

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

The panel must be xtset and balanced (each unit must have the same
number of time observations within the if/in sample).

Specification
trend(spec) deterministics: none, c, ct, ctt
(default: c)

approach(name) auto (default), indep, or factors

factors shortcut for approach(factors)

Factor model (common-factor branch)
rmax(#) maximum number of common factors (default 6)

ic(name) factor-number IC: ic1, ic2 (default), ic3,
bic3

ADF lag selection
pmax(#) maximum lag for ADF augmentation (default 5)

lagsel(crit) tsig (default, Ng-Perron 1995), aic, bic,
hqic, fixed

lags(#) fixed lag when lagsel(fixed) (default 0)

Reporting
level(#) confidence level; default 95

graph call xtmulticointgrat_graph after estimation

grsave(filename) export the diagnostic graph to a file

notable suppress result tables

Description

xtmulticointgrat tests for multicointegration - a "second layer" of
long-run equilibrium - in a balanced panel of N cross-sectional units
observed over T periods. A standard cointegrating relationship is

y_i,t = c_t α_i + x_i,t β_i + ϑ_i,t

with ϑ_i,t I(0). Multicointegration arises when the cumulated equilibrium
error S_i,t = Σ ϑ_i,j is itself cointegrated with the original I(1)
flows, that is

y_i,t = m_t μ_i + S_i,t γ_i + u_i,t

with u_i,t I(0). The classical Granger-Lee (1989) production / sales /
inventory example is the canonical illustration. When at least two cross-sectional
units share common stochastic trends, the test must be modified to account for
cross-section dependence; Berenguer-Rico & Carrion-i-Silvestre (2006) adapt the
Bai-Ng (2004) PANIC framework for this purpose.

xtmulticointgrat offers two testing branches.

Branch A - cross-section independent (approach(indep))

Computes Pedroni-style between-dimension panel statistics from the one-step
Engsted-Gonzalo-Haldrup (1997) multicointegration regression and standardizes
them using the Monte-Carlo moments Θ_1, Ψ_1, Θ_2, Ψ_2 reported in Tables
1 and 2 of the paper. Returns:

Z_ρ_NT

between-dimension normalized-bias statistic

Z_t_NT

between-dimension t-ratio statistic

Z_ρ_NT^std, Z_t_NT^std

standardized to converge to N(0,1) under the null of no
multicointegration

Branch B - common factors (approach(factors), default)

Implements the Granger-Lee (1989) two-step regression and the PANIC procedure
of Bai-Ng (2004) on the stage-2 residual u_i,t:

1. Stage 1: y_i,t = c_t α_i + x_i,t β_i + ϑ_i,t → OLS residual,
cumulate to S_i,t.

2. Stage 2: y_i,t = m_t μ_i + S_i,t γ_i + u_i,t → OLS residual
u_i,t.

3. PCA on Δu_i,t (demeaned) yields common factors F̂_t and
loadings π̂_i; the number of factors is chosen by a Bai-Ng panel
information criterion.

4. Idiosyncratic component ê_i,t (recovered by cumulation) is
tested for a unit root by pooling individual ADF t-statistics, standardized
with Table 3 moments.

5. Common factors are tested individually with ADF (acting as a
simplified MQ_c test); the number q̂ of non-stationary factors is
returned.

The overall conclusion combines the two pieces. Multicointegration
exists if ρ_i < 1 for all i (idiosyncratic ADF rejects unit root) and
C(1) has zero rank (no non-stationary common stochastic trend). Cross-
multicointegration appears as a mild case in which the idiosyncratic component
is stationary but some common stochastic trends remain.

Options

trend(spec) controls the deterministic component of the regressions:
none (no deterministics), c (constant), ct (constant + linear
trend), ctt (constant + linear + quadratic trend). Default: c.

approach(name) selects the testing branch:
indep for the cross-section independent case (Pedroni-style pooling),
factors for the common-factor case (PANIC), auto (default) selects
factors.

factors is a synonym for approach(factors).

rmax(#) maximum number of common factors to consider when selecting the
factor count by panel BIC. Default 6.

ic(name) information criterion for selecting the number of common factors:
ic1, ic2, ic3 of Bai-Ng (2002), or bic3. Default ic2.

pmax(#) maximum lag of the ADF augmentation for both idiosyncratic and
factor tests. Default 5.

lagsel(crit) criterion for selecting the ADF lag length:
tsig (Ng & Perron 1995 sequential t-rule, default), aic, bic,
hqic, fixed.

graph produces a publication-style diagnostic dashboard immediately after
the test. See xtmulticointgrat_graph for layout options.

Stored results

r() scalars (common to both branches)

r(N) number of panels actually used

r(T) number of time observations per panel

r(m1) number of I(1) flow regressors per panel

r() scalars - independent branch

r(Z_rho) raw pooled normalized-bias statistic

r(Z_t) raw pooled t-ratio statistic

r(Z_rho_std) standardized N(0,1) version

r(Z_t_std) standardized N(0,1) version

r(p_rho), r(p_t) asymptotic p-values (lower tail)

r(Theta1)/Psi1/Theta2/Psi2) moments used for standardization

r() scalars - factor branch

r(r) estimated number of common factors r̂

r(q_nonstat) estimated number of non-stationary common factors q̂

r(Z_idio) raw pooled idiosyncratic ADF

r(Z_idio_std) standardized N(0,1)

r(p_idio) asymptotic p-value

r(Theta_e)/Psi_e) Table-3 moments

r() matrices

r(adf_indiv) per-i ADF results: (ρ̂_i, t_ρ̂_i, Σφ̂_i, lag) [indep]

r(adf_idio) same but for idiosyncratic component [factors]

r(mq_factors) ADF on each estimated factor

r(loadings) factor loadings Λ̂ (N x r̂)

r() macros

r(cmd) xtmulticointgrat

r(approach) indep or factors

r(trend) deterministic specification

r(depvar) flow y variable

r(indep) flow x variables

Permanent variables added to the data (factor branch only)

_xtmcg_S_i stage-1 cumulated residual S_i,t

_xtmcg_u_i stage-2 residual u_i,t

_xtmcg_e_i idiosyncratic component e_i,t

_xtmcg_F1, _xtmcg_F2, ... estimated common factors

Examples

1. Production / sales / inventories panel (Granger-Lee 1989 style)

xtset industry month

xtmulticointgrat sales production, trend(c)

xtmulticointgrat_graph, layout(default) save(fig1.png)

2. Strong cross-section dependence -- use the common-factor approach

xtmulticointgrat sales production, factors trend(ct) rmax(6) ic(ic2)

3. Independent panels (small N, Pedroni-style pooling)

xtmulticointgrat y x, approach(indep) trend(c) pmax(5) lagsel(tsig)

4. Use BIC for ADF lag selection and a quadratic trend

xtmulticointgrat y x, factors trend(ctt) lagsel(bic) pmax(8)

5. Multiple flow regressors

xtmulticointgrat consumption income wealth, factors trend(ct)

Remarks and limitations

1. The panel must be balanced under the if/in sample. Unbalanced panels
must be rectangularised first (e.g. with xtbalance).

2. The asymptotic theory assumes (T → ∞ then N → ∞)_seq. Practical experience
in the paper suggests T = 100 with N up to 40-50 gives correct size for the
independent branch; the common-factor branch needs T larger than about 100.

3. The factor-component ADF/MQ test implemented here is a simplified version of
the full Bai-Ng (2004) MQ procedure: it applies an ADF unit-root test to each
estimated factor separately (with the same deterministics as the second-stage
regression). Users seeking the exact MQ_f / MQ_c statistics with formal lag
order selection should run them externally on the saved _xtmcg_F*
variables.

4. Coefficients of the second-stage regression are computed but not reported
because the limit distribution depends on nuisance parameters (Engsted et al
1997). Inference focuses on the residual unit-root tests.

References

Bai, J. and Ng, S. (2002). "Determining the number of factors in approximate
factor models." Econometrica 70, 191-221.

Bai, J. and Ng, S. (2004). "A PANIC attack on unit roots and cointegration."
Econometrica 72, 1127-1177.

Banerjee, A. and Carrion-i-Silvestre, J.Ll. (2006). "Cointegration in Panel
Data with Breaks and Cross-section Dependence." ECB Working Paper 591.

Berenguer-Rico, V. and Carrion-i-Silvestre, J.Ll. (2006). "Testing for
Multicointegration in Panel Data with Common Factors." Oxford Bulletin of
Economics and Statistics 68 (Supplement), 721-744.

Engsted, T., Gonzalo, J. and Haldrup, N. (1997). "Testing for
multicointegration." Economics Letters 56, 259-266.

Granger, C.W.J. and Lee, T.-H. (1989). "Investigation of production, sales and
inventory relationships using multicointegration and non-symmetric error
correction models." Journal of Applied Econometrics 4, S145-S159.

Haldrup, N. (1994). "The asymptotics of single-equation cointegration
regressions with I(1) and I(2) variables." Journal of Econometrics 63,
153-181.

Ng, S. and Perron, P. (1995). "Unit root tests in ARMA models with data
dependent methods for the selection of the truncation lag."
Journal of the American Statistical Association 90, 268-281.

Pedroni, P. (2004). "Panel cointegration: asymptotic and finite sample
properties of pooled time series tests with an application to the PPP
hypothesis." Econometric Theory 20, 597-625.

Author

Dr Merwan Roudane

Email: merwanroudane920@gmail.com

xtmulticointgrat v1.0.0 - 22 May 2026. Bug reports and suggestions welcome.

Also see

Online: xtmulticointgrat_graph, multicoint, xtpedroni,
xtbreakcoint, xtcointtest