Skip to content

DPredict · Guide test 222

Pesaran CIPS test

Averages cross section augmented Dickey–Fuller statistics to address common cross sectional dependence.

Runs in CodeSplashPython (calls R) example not runR example validated

Do it in CodeSplash

In the app, set it up in Analyze with this method:

  • Panel unit-root tests — Across many units (countries, stores, firms), do the series have unit roots — or are some or all of them stationary?

In Panel unit-root tests, choose Test = Pesaran CIPS.

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Pesaran CIPS test

8
40
0.50
0.50

0: every unit has a unit root (H₀ of the unit-root tests).

0.050

Your data

Simulated with known truth

8 series of length 40: 4 stationary (solid) and 4 with a unit root (dashed). Stationary units keep returning to their own level; random walks drift away.

If H₀ were true

CIPS = −2.61
  1. The reference: how CIPS varies across samples when H₀ is true, CIPS of 8 independent random walks of length 40 (Monte Carlo null: 999 samples simulated under H₀ (seed 20261107)).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .014).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

Δyit=ai+biyi,t−1+ciyˉt−1+diΔyˉt+ϕiΔyi,t−1+…,CIPS=1N∑itbi\Delta y_{it} = a_i + b_i y_{i,t-1} + c_i\bar y_{t-1} + d_i\Delta\bar y_t + \phi_i\Delta y_{i,t-1} + \dots,\qquad CIPS = \tfrac1N\sum_i t_{b_i}

With your numbers

CIPS=(−2.61),N=8, T=40CIPS = (-2.61),\qquad N = 8,\ T = 40
yˉt\bar y_t
cross-sectional mean: a proxy for the common factor
tbit_{b_i}
t ratio of b_i in unit i's augmented ADF

The verdict

CIPS = −2.61, p = .014

p ≤ α = .050: reject H₀

The cross-sectional averages soak up a common factor that would distort LLC and IPS.

Statistic
−2.607
p-value
0.0140
Pesaran CIPS test on 8 series of length 40, 4 stationary: CIPS = −2.61, p = .014. The p-value is below α = .050, so the data are hard to reconcile with H0.

Pesaran CIPS test on 8 series of length 40, 4 stationary: CIPS = −2.61, p = .014. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: all panel units have unit roots; H1: some units are stationary.

Assumptions

Panel dependence is representable by the common-factor structure addressed by cross-sectional augmentation; adequate N,T and correctly selected lag/deterministic terms.

Formula

Δyit=ai+biyi,t−1+ciyˉt−1+∑jdijΔyˉt−j+∑jϕijΔyi,t−j+eitCIPS=N−1∑itbi\begin{gathered}\Delta y_{it}=a_i+b_iy_{i,t-1}+c_i\bar y_{t-1}+\sum_jd_{ij}\Delta\bar y_{t-j}+\sum_j\phi_{ij}\Delta y_{i,t-j}+e_{it}\\[5pt] CIPS=N^{-1}\sum_it_{b_i}\end{gathered}

Parameters and notation

Cross-sectional means ȳ capture common factors; CADF is the unit-specific augmented test. Truncated CIPS versions bound extreme unit statistics.

Structure of the method

For each unit, augment its Dickey–Fuller regression with cross-sectional mean levels and differences as proxies for common factors, then average the individual lagged-level t statistics. Some variants truncate extreme statistics. The resulting CIPS statistic has its own calibration and is not an ordinary independent t-statistic average.

Estimated and nuisance parameters

Estimate unit autoregressive and short-run coefficients, deterministic effects, loadings on cross-sectional averages, and innovation quantities. Cross-sectional means are generated regressors computed from the panel. Their quality depends on cross-sectional size, factor structure, and missingness, not merely on the number of observed rows.

Settings and design choices

Choose augmentation lag order, deterministic specification, model variant, truncation, and a sufficiently supported panel size. More augmentation captures dynamics but increases parameter count in each short regression. Changing the number of included units also changes the common-factor proxy and therefore the tested specification.

Fitting and adaptation

Recompute cross-sectional means and all unit regressions whenever the panel or lag rule changes. Use critical values or simulations matching the deterministic and truncation choices. The existing cmg code selects the cross-section-augmented route; alternative model arguments should not be treated as equivalent dependence corrections.

Sensitivity and robustness

Inspect heterogeneous factor loadings, weak/strong common shocks, structural breaks, and extremely short time dimensions. Cross-sectional averages do not remove every form of dependence. Report unit-level diagnostic behavior and the fraction-stationary interpretation rather than claiming that a single rejection makes the whole panel stationary.

How to use and calibrate

Use Pesaran CIPS tables/simulation for N,T and deterministic specification; not a standard normal tail.

Example application

Test panel persistence in the presence of shared shocks.

Interpretation and pitfalls

Watch out

Cross-sectional averages do not solve arbitrary dependence structures. Specify truncation and lag choices.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

Cross-sectionally augmented panel unit-root test; pd$y is a pseries carrying id/time indexes.

Python · invokes R

Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: plm

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
N<-20;TT<-25;d<-expand.grid(time=1:TT,id=1:N);d$x<-rnorm(nrow(d));a<-rnorm(N);d$y<-.5*d$x+a[d$id]+rnorm(nrow(d));pd<-plm::pdata.frame(d,index=c("id","time"))
print(plm::cipstest(pd$y,lags=1,type="drift",model="cmg"))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Validated — Executed successfully in the validation environment · needs plm

set.seed(2026)
N<-20;TT<-25;d<-expand.grid(time=1:TT,id=1:N);d$x<-rnorm(nrow(d));a<-rnorm(N);d$y<-.5*d$x+a[d$id]+rnorm(nrow(d));pd<-plm::pdata.frame(d,index=c("id","time"))
print(plm::cipstest(pd$y,lags=1,type="drift",model="cmg"))
Output
	Pesaran's CIPS test for unit roots

data:  pd$y
CIPS test = -3.0799, lag order = 1, p-value = 0.01
alternative hypothesis: Stationarity

Sources

Statistics guide v4 (historical):
Python: Executed end to end through Rscript · R: Executed successfully in the validation environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 222, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT222.