*! version 1.0.0 06jun2026

Title

xtpgc -- Bootstrap panel Granger causality in heterogeneous mixed panels
(Emirmahmutoglu & Kose 2011 Fisher; Konya 2006 SUR-Wald)

Syntax

xtpgc varlist [if] [in] [, options]

varlist contains 2 or more time-series variables. All ordered pairs
(cause -> effect) are tested. method(konya) requires exactly 2 variables.

Test
method(fisher|konya) causality test; default fisher

maxlags(#) maximum VAR/SUR lag order considered; default maxlags(4)

dmax(#) extra (Toda-Yamamoto) lags = max integration order; default dmax(1) (fisher only)

ic(#) lag-selection criterion: 1=AIC, 2=SIC; default ic(1)

Bootstrap
breps(#) bootstrap replications; default breps(1000)

seed(#) random-number seed

noboot report asymptotic results only (no bootstrap critical values)

Reporting & graph
graph plot the causality results

noprintind suppress per-unit individual results (fisher)

graph_options options passed to the graph

The data must be xtset and the panel balanced.
xtpgc is part of the xtpdlib library.

Description

xtpgc tests for Granger (non-)causality between variables in heterogeneous mixed
panels, allowing for cross-section dependence through a residual-resampling bootstrap
that preserves the contemporaneous correlation across units. Two tests are available.

Fisher (Emirmahmutoglu and Kose, 2011). A level VAR is fitted
for each unit with k_i + dmax lags (the lag-augmented / Toda-Yamamoto approach,
so the Wald statistics are valid regardless of the integration and cointegration
properties). The individual Wald statistic for non-causality has a chi-squared
distribution with k_i degrees of freedom; the panel statistic combines the
individual p-values via Fisher's (1932) method,

Fisher = -2 * sum_i ln(p_i) ~ chi2(2N).

Because cross-sectional dependence invalidates the asymptotic distribution, bootstrap
critical values are computed (the empirical distribution of the Fisher statistic under
the non-causality null). This is the test used in
Kar, Nazlioglu and Agir (2011).

Konya SUR-Wald (Konya, 2006). A two-equation system is estimated
by Seemingly Unrelated Regressions across all units, giving a country-specific Wald
statistic for each unit together with its own bootstrap critical values, so causality can
differ across units.

xtpgc is a Stata translation of the GAUSS routines pd_cause,
PDcaus_Fisher and PDcaus_SURwald from S. Nazlioglu's TSPDLIB. The
Dumitrescu-Hurlin (2012) Zbar test (the third option of pd_cause) is available via the
community command xtgcause.

Options

method(fisher|konya) selects the test. fisher (default) is the
Emirmahmutoglu-Kose panel Fisher test for any number of variables; konya
(synonym surwald) is the Konya SUR-Wald test for exactly two variables.

maxlags(#) is the maximum lag order searched by the information criterion.

dmax(#) is the number of extra unrestricted lags added for the
Toda-Yamamoto augmentation (the maximum suspected order of integration). Used by
fisher only.

ic(#) chooses 1 = Akaike or 2 = Schwarz for lag selection.

breps(#) sets the number of bootstrap replications.

seed(#) fixes the seed for reproducible bootstrap results.

noboot skips the bootstrap and reports only asymptotic results (the Fisher
chi-squared p-value; Konya Wald with no critical values).

graph draws the results: for fisher, a bar chart of the panel Fisher
statistic for each causal direction with the bootstrap 5% critical value; for
konya, per-unit Wald statistics against the unit-specific 5% bootstrap critical
value.

noprintind suppresses the per-unit table under fisher.

Methods and formulas

Bootstrap. Both tests use a fixed-design residual bootstrap. The model is
re-estimated under the non-causality null (the cause's lags are removed from the effect
equation); the centered residuals are resampled jointly across units (the same time
indices are drawn for every unit) to preserve cross-section dependence; a bootstrap
dependent variable is built from the restricted fit plus the resampled residuals; and
the test statistic is recomputed on the original regressor design. Repeating this many
times yields the bootstrap distribution and its percentiles.

Interpretation

The null for every reported block is "cause does not Granger-cause effect".
Rejection means there is predictive (Granger) causality from the cause to the effect.

Fisher (panel) decision. Use the bootstrap critical values, not the asymptotic
chi-squared p-value, when cross-section dependence is present (the usual case) -
the asymptotic distribution is invalid under dependence. Reject the panel non-causality
null at 5% when Fisher statistic > bootstrap 5% CV. The asymptotic p-value
[chi2(2N)] is printed for reference and is the right one only under cross-sectional
independence (noboot).

Reading the per-unit Fisher table. Each unit contributes a Wald statistic
(chi-squared with k_i d.f.) and its p-value; the panel Fisher statistic combines
these p-values. Units with small p-values are the ones generating panel-level causality.
Because the VAR is lag-augmented (Toda-Yamamoto), the Wald statistics are valid whatever
the integration/cointegration status, so you do not need to pre-difference.

Konya decision (per unit). Konya gives a country-specific answer: for each unit,
reject non-causality at 5% when Wald > 5% CV (flagged with * in the table). This
lets causality differ across units - report which units show causality rather than
a single panel verdict.

Direction. Run the command and read each "H0: A does not cause B" block separately;
two-way (feedback) causality is present when both directions reject, one-way when only one
does, and independence when neither does.

Cautions

o Balanced panel only, declared with xtset.

o Bootstrap is essential under cross-section dependence. Keep noboot only
for a quick look or when units are genuinely independent. Use enough replications
(breps(1000) or more for final results; the examples use small values for speed) and
set seed() for reproducibility.

o dmax must cover the integration order. dmax() is the number of extra
unrestricted lags in the lag-augmented VAR and must be >= the maximum order of integration
of the variables (run unit-root tests first; dmax(1) is typical for I(1) data). Too
small a dmax() invalidates the Toda-Yamamoto argument.

o Lag length. maxlags() bounds the VAR/SUR order chosen by AIC/SIC.
Larger systems (many variables or units) need more degrees of freedom: ensure
T is comfortably larger than (number of variables) x (maxlags+dmax).

o Konya needs exactly two variables and is computationally heavier (SUR with a
country-specific bootstrap); reduce breps() while exploring.

o Number of directions. With K variables method(fisher) tests all
K(K-1) ordered pairs; output can be long. Use noprintind to hide the per-unit tables.

o Bootstrap scheme. The implementation uses a fixed-design residual bootstrap
that resamples centred residuals jointly across units (preserving cross-section
dependence). The test statistics and Fisher combination match the published method; the
bootstrap follows the Emirmahmutoglu-Kose / Konya design.

o Dumitrescu-Hurlin. For the Zbar/Zbar-tilde panel non-causality test, use the
community command xtgcause; it is not duplicated here.

Examples

Setup

. webuse grunfeld, clear

. xtset company year

Panel Fisher causality between two variables, reproducible bootstrap

. xtpgc invest mvalue, method(fisher) maxlags(2) dmax(1) breps(1000) seed(123)

Three variables (all six directions), hide per-unit tables, with the summary graph

. xtpgc invest mvalue kstock, method(fisher) maxlags(2) dmax(1) breps(500) noprintind graph

Konya SUR-Wald with country-specific bootstrap critical values

. xtpgc invest mvalue, method(konya) maxlags(2) breps(1000) seed(1) graph

Quick asymptotic Fisher only (no bootstrap)

. xtpgc invest mvalue kstock, method(fisher) maxlags(2) dmax(1) noboot

Use the stored results (directions are rows of r(pairs))

. xtpgc invest mvalue, method(fisher) breps(500) seed(1)

. matrix list r(pairs)

. matrix list r(units)

Stored results

xtpgc stores the following in r():

Scalars

r(N), r(T) panel dimensions

Matrices (method fisher)

r(pairs) one row per direction: effect idx, cause idx, Fisher, asy p-value, 10%/5%/1% bootstrap CV

r(units) one row per direction x unit: direction, id, lag, Wald, p-value

Matrices (method konya)

r(pairs) one row per direction: effect idx, cause idx

r(units) direction, id, Wald, 1%/5%/10% bootstrap CV

Macros

r(method) fisher or konya

r(cmd) xtpgc

References

Emirmahmutoglu, F., and N. Kose. 2011. Testing for Granger causality in
heterogeneous mixed panels. Economic Modelling 28: 870-876.

Konya, L. 2006. Exports and growth: Granger causality analysis on OECD countries
with a panel data approach. Economic Modelling 23: 978-992.

Kar, M., S. Nazlioglu, and H. Agir. 2011. Financial development and economic
growth nexus in the MENA countries: bootstrap panel Granger causality analysis.
Economic Modelling 28: 685-693.

Dumitrescu, E.-I., and C. Hurlin. 2012. Testing for Granger non-causality in
heterogeneous panels. Economic Modelling 29: 1450-1460.

Toda, H. Y., and T. Yamamoto. 1995. Statistical inference in vector
autoregressions with possibly integrated processes. Journal of Econometrics
66: 225-250.

Author

Stata implementation:

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane

Original GAUSS code (TSPDLIB):

Saban Nazlioglu, Pamukkale University, snazlioglu@pau.edu.tr

See also:

xtpdlib, xtfpss, xtcipsm