*! version 1.0.0 21jun2026

Title

xtnonlincoint fffff -- Fractional frequency flexible Fourier form
(FFFFF) panel cointegration test (Olayeni, Tiwari & Wohar 2021)

Syntax

xtnonlincoint fffff depvar indepvars [if] [in]
[, options]

Model
maxlags(#) maximum lag in the KSS-Fourier ADF regression; the lag
is chosen by AIC up to this value; default maxlags(1)

kstep(#) step of the fractional-frequency grid searched on
[0.1, 2]; default kstep(0.1)

trend include a linear trend in the cointegrating regression;
default is constant only

Bootstrap
breps(#) stationary-bootstrap replications; default breps(299)

block(#) mean block length of the stationary bootstrap; default
0 = round(sqrt(T))

seed(#) random-number seed; default seed(12345)

Reporting
spsm report the Sequential Panel Selection Method table

level(#) confidence level for reporting; default level(95)

graph draw the individual-statistics bar chart and the SPSM
sequence plot

noprint suppress the results table

The panel must be xtset and balanced.

Description

xtnonlincoint fffff implements a panel cointegration test that is robust to
(i) nonlinearity, (ii) an unknown number and form of smooth structural breaks
and (iii) cross-sectional dependence. For each panel the cointegrating residual
nu(it) from the levels regression of depvar on indepvars is tested for a
unit root with the Kapetanios-Shin-Snell (KSS) nonlinear ADF regression
augmented with a flexible Fourier term:

D.nu(it) = a(i) + g(i)*nu(i,t-1)^3 + sum_j h(ij)*D.nu(i,t-j)
+ chi(i)*sin(2*pi*k*t/T) + phi(i)*cos(2*pi*k*t/T) + e(it).

The frequency k is treated as a fractional quantity and searched
jointly with the lag length on a grid; the fractional form nests the integer
case and protects the small-sample properties (Omay 2015). The individual KSS
statistic is the t-ratio on g(i). A stationary bootstrap applied jointly to
all panels delivers cross-section-dependence-robust p-values, and the
Sequential Panel Selection Method (SPSM) removes the most stationary series one
at a time to reveal which cross-sections generate the panel cointegration.

Options

maxlags(#) caps the augmentation lag; the AIC selects the lag (and, for
the FFFFF, the frequency) jointly.

kstep(#) controls the resolution of the fractional-frequency grid on
[0.1, 2]. A finer grid is more faithful to the continuous search but slower.

trend adds a linear trend to the first-stage cointegrating regression.

block(#) sets the mean block length of the Politis-Romano stationary
bootstrap; 0 uses round(sqrt(T)). Longer blocks preserve more serial dependence.

spsm prints the SPSM table: at each step the group statistic, its
bootstrap p-value, and the series (most stationary, lowest KSS) removed.

graph produces a two-panel figure: the individual KSS statistics with
their 5% critical value, and the group statistic across SPSM steps.

Method

Under the null of no cointegration the residual nu(it) is I(1). The bootstrap
imposes this by resampling the differenced residuals D.nu with a common
(cross-panel) stationary-bootstrap index, cumulating them into a pseudo random
walk, re-projecting it on the original regressors (so the pseudo-residual
carries the same spurious mean reversion as the observed residual), and then
re-running the joint frequency/lag selection on every replication. Letting
the bootstrap repeat the whole statistic - including the search over k - is
what keeps the test correctly sized; holding k fixed in the bootstrap would
ignore the selection advantage of the observed statistic and over-reject. The
group p-value is the share of bootstrap group means at or below the
observed group mean. SPSM compares the group mean of the current active set
to its bootstrap distribution at every step.

Finite-sample behaviour. Because the frequency search is fully
bootstrapped, the test is mildly conservative in small panels (empirical
size below the nominal level) while retaining good power against genuine
cointegration. This errs on the safe side: it does not spuriously declare
cointegration. Size approaches the nominal level as T grows. The companion
ecm test is an alternative that is close to nominal
size in small samples.

Examples

. webuse grunfeld, clear

. xtset company year

. xtnonlincoint fffff invest mvalue kstock

. xtnonlincoint fffff invest mvalue kstock, maxlags(2) spsm graph

. matrix list r(spsm)

Stored results

xtnonlincoint fffff stores the following in r():

Scalars

r(stat) group-mean KSS statistic

r(p) bootstrap p-value

r(cv10), r(cv5), r(cv1) group critical values

r(N) number of panels

r(T) number of periods

r(nstat) number of panels with a computable statistic

Macros

r(depvar) dependent variable

r(indepvars) long-run regressors

r(test) test label

Matrices

r(indstat) per-panel: id, KSS, k, lag, p-value, cv10, cv5, cv1

r(spsm) SPSM path: step, group KSS, p-value, min KSS, k, id

r(bootdist) bootstrap null distribution of the group statistic

References

Kapetanios, G., Y. Shin, and A. Snell. 2003. Testing for a unit root in the
nonlinear STAR framework. Journal of Econometrics 112: 359-379.

Omay, T. 2015. Fractional frequency flexible Fourier form to approximate smooth
breaks in unit root testing. Economics Letters 134: 123-126.

Olayeni, R. O., A. K. Tiwari, and M. E. Wohar. 2021. Fractional frequency
flexible Fourier form (FFFFF) for panel cointegration test. Applied
Economics Letters 28(6): 482-486.
doi:10.1080/13504851.2020.1761526.

Author

Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane