Title

xtfpanic -- Fourier-PANIC panel unit root test: PANIC with smooth
(Fourier) structural breaks and a common factor structure (Nazlioglu et al. 2023)

Syntax

xtfpanic varname [if] [in] [, options]

The data must be xtset as a strongly balanced panel.

freq(#) maximum cumulative Fourier frequency (m): 1 (default), 2 or 3

kmax(#) maximum number of common factors (default 5)

icfactor(#) factor-number criterion: 1=PCp, 2=ICp (default), 3=AIC/BIC

pmax(#) maximum lags for the LM regression (default 3)

iclag(#) lag criterion: 1=AIC, 2=SIC, 3=t-sig (default)

Description

xtfpanic implements the panel unit root test of Nazlioglu et al. (2023),
which combines two ideas: a Fourier approximation to capture smooth,
unknown-form structural breaks, and the PANIC procedure of Bai and Ng
(2004) to control for cross-sectional dependence through common factors. The test
therefore allows for both multiple gradual breaks and strong
cross-correlation, without having to specify the number, location, or form of the
breaks.

The steps are: (i) difference the data; (ii) remove a flexible Fourier trend from
each differenced series; (iii) extract the common factors from the
Fourier-detrended differences by principal components; (iv) form the
idiosyncratic component; (v) run a Fourier-augmented LM unit root regression on
each unit's cumulated idiosyncratic component, with the estimated factors as
additional regressors; (vi) pool the p-values into the Fisher-type panel
statistics P and Pm using the paper's response surface.

xtfpanic is part of the xtflexur library and shares its
common-factor engine with xtpanic. See help
xtfpanic methods for the formulas.

Options

freq(#) sets the maximum cumulative Fourier frequency m: 1
uses frequency 1 only (default), 2 uses frequencies 1 and 2, 3 uses
1, 2 and 3. Higher m captures more break flexibility at the cost of power.

kmax(#), icfactor(#) govern the common-factor estimation (as in
xtpanic): maximum factors (default 5) and the Bai-Ng (2002) criterion
(default ICp).

pmax(#), iclag(#) govern the LM-regression lag length: maximum
lags (default 3) and the selection rule (3=general-to-specific t-test at
10%, the default).

Examples

Fourier-PANIC with a single frequency:

. xtset country year

. xtfpanic lhealth, freq(1)

Cumulative frequencies 1 and 2:

. xtfpanic lhealth, freq(2) kmax(5) pmax(3)

Stored results

xtfpanic is rclass and stores:

Scalars

r(P), r(P_p) Fisher chi-square panel statistic and p-value

r(Pm), r(Pm_p) standardized (normal) panel statistic and p-value

r(nf) estimated number of common factors

r(N), r(T) panel and time dimensions

Matrices

r(units) per-unit id, Fourier-LM statistic, p-value, lags

Macros

r(cmd) xtfpanic

Interpreting the output

The null is a unit root in the idiosyncratic component. The pooled tests
P (Fisher chi-square) and Pm (standardized normal) reject for large
values / small p-values. Because the test removes both smooth breaks and common
factors, a non-rejection is strong evidence of genuine non-stationarity that
cannot be explained away by breaks or cross-sectional dependence. In the paper's
healthcare application, allowing for both features leaves the null of a unit root
un-rejected, unlike the simpler tests.

References

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

Enders, W., and J. Lee. 2012. The flexible Fourier form and Dickey-Fuller
type unit root tests. Economics Letters 117: 196-199.

Nazlioglu, S., et al. 2023. Smooth structural changes and common factors in
nonstationary panel data: an analysis of healthcare expenditures. Econometric
Reviews 42(1): 78-97.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane

Faithful Stata port of the GAUSS code (appl3_PANIC_fourier) by S. Nazlioglu
et al.; validated byte-for-byte against Table 3 of Nazlioglu et al. (2023). Part
of the xtflexur library.