*! version 1.0.0 05jun2026

Title

xtfdh -- Fourier Dumitrescu-Hurlin panel Granger non-causality test

Syntax

xtfdh
depvar causevar
[if] [in]
[, options]

Main
lags(#) lag order K of the causality regressions; default lags(1)

direction(d) forward, reverse or both (default)

Fourier
maxk(#) maximum Fourier frequency searched; default maxk(3)

k(#) fix the Fourier frequency

fractional search frequencies in 0.1 steps

nofourier standard (non-Fourier) Dumitrescu-Hurlin test

Reporting
regress display each cross-section unit's Wald statistic

nograph suppress the Wald-distribution graph

graphprefix(string) filename prefix for exported .png

The data must be xtset. xtfdh tests, in the
forward direction, the null that causevar does not Granger-cause
depvar.

Description

xtfdh implements the Fourier Dumitrescu-Hurlin (FDH) test of Granger
non-causality in heterogeneous panels (Ersin 2026), generalizing the
Dumitrescu & Hurlin (2012) test by adding Enders-Lee Fourier terms to each
unit's regression so that smooth structural breaks do not contaminate the
causality inference. With nofourier it reproduces the standard DH test
(as in xtgcause).

By default (direction(both)) the command tests both directions and prints
a bidirectional / unidirectional verdict, mirroring the causality tables of
Ersin (2026) and Sardarli & Suleymanli (2026). It also draws the distribution of
the individual Wald statistics against the {&chi}2 reference, revealing the
heterogeneity of causality across units.

Options

lags(#) sets the common lag order K of y and of the causing variable
in each unit regression. Each unit must have more than 2K (+2 for the Fourier
terms) usable observations.

direction(d) chooses which null(s) to test: forward
(causevar depvar), reverse, or both (default,
adds the verdict block).

maxk(#), k(#), fractional, nofourier govern the
Fourier frequency exactly as in xtpfardl: by default the single optimal
frequency is chosen by minimum pooled SSR.

regress prints each unit's Wald statistic; graph controls and
graphprefix() names the exported figure.

Methodology

For each unit i the command fits

y(i,t) = {&alpha}(i) + {&Sigma}{&gamma}(i,k)·y(i,t-k) + {&Sigma}{&beta}(i,k)·x(i,t-k)
+ {&lambda}0(i)·sin(2{&pi}kt/T) + {&lambda}1(i)·cos(2{&pi}kt/T) + {&epsilon}(i,t),

and forms the individual Wald statistic W(i) = K·F(i) for H0: {&beta}(i,1) = ... =
{&beta}(i,K) = 0. The panel statistics are the average W-bar and the standardized

Z-bar = sqrt(N/2K)·(W-bar - K),

Z-tilde = sqrt[ N/2K · (T-3K-5)/(T-2K-3) ]·[ (T-3K-3)/(T-3K-1)·W-bar - K ],

both standard normal under the null. The finite-T statistic Z-tilde is the
recommended one (it corresponds to Z-bar in EViews). Two-sided p-values are
reported, following the xtgcause convention.

Examples

. xtset id year

Both directions, Fourier-augmented, 2 lags

. xtfdh co2 y, lags(2)

One direction only, fixed frequency

. xtfdh fcd fd, direction(forward) k(1)

Standard (non-Fourier) Dumitrescu-Hurlin test

. xtfdh co2 ret, lags(1) nofourier

Stored results

xtfdh stores the following in r():

Scalars

r(lags) lag order K

r(kstar) selected Fourier frequency

r(wbar_f), r(zbar_f), r(zbart_f), r(p_f) forward direction

r(wbar_r), r(zbar_r), r(zbart_r), r(p_r) reverse direction

References

Bildirici, M., and F. Kay{&iacute}k{&ccedil}{&inodot}. 2022. Renewable energy and current
account balance nexus. Environmental Science and Pollution Research 29:
48759-48768. doi:10.1007/s11356-022-19286-9.

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

Ersin, {&Ouml}. {&Ouml}. 2026. Decoupling of CO2 emissions from growth with
energy transition and eco-innovations in OECD. Sustainability 18(6): 2728.
doi:10.3390/su18062728.

Lopez, L., and S. Weber. 2017. Testing for Granger causality in panel
data. Stata Journal 17: 972-984.

Also see

Help: xtpfardl (Fourier panel ARDL estimator),
xtgcause (standard DH test), fbardl

Author: Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

GitHub: github.com/merwanroudane