Skip to content

DPredict · Guide test 219

Maddala–Wu Fisher panel unit root test

Combines individual series’ unit root p values using Fisher’s method.

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 = Maddala–Wu (Fisher χ²).

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 · Maddala–Wu Fisher panel unit root test

8
100
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 100: 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

P = 123.00 →
  1. The reference: how P varies across samples when H₀ is true (χ² over unit p-values (MacKinnon 1994)).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = < .001).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

P=−2∑i=1Nln⁡pi∼χ2N2P = -2\sum_{i=1}^{N}\ln p_i \sim \chi^2_{2N}

With your numbers

P=123.0,df=16P = 123.0,\qquad df = 16
pip_i
ADF p-value of unit i (MacKinnon)

The verdict

P(16) = 123.00, p < .001

p ≤ α = .050: reject H₀

Fisher's method works with unbalanced panels and different lags per unit; it assumes independent units. The unit p-values are asymptotic (MacKinnon), so short series make the combined test liberal.

Statistic
123.001
p-value
0.0000
Maddala–Wu Fisher panel unit root test on 8 series of length 100, 4 stationary: P(16) = 123.00, p < .001. The p-value is below α = .050, so the data are hard to reconcile with H0.

Maddala–Wu Fisher panel unit root test on 8 series of length 100, 4 stationary: P(16) = 123.00, p < .001. 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: at least one is stationary.

Assumptions

A panel with explicitly modeled individual deterministic terms and sufficient time observations. First-generation panel unit-root tests generally assume cross-sectional independence; lag lengths and balance conventions matter.

Formula

P=−2∑i=1Nlog⁡pi∼χ2N2P=-2\sum_{i=1}^{N}\log p_i\sim\chi^2_{2N}

Parameters and notation

pi are valid individual unit-root p values; Fisher combination requires independence for the stated reference.

Structure of the method

Run a valid individual unit-root test for every included unit, transform each p value by minus twice its logarithm, and sum. Under independent continuous uniform null p values the combined statistic has chi-square degrees of freedom equal to twice the number of tests. This is Fisher combination applied to panel persistence.

Estimated and nuisance parameters

Estimate the nuisance regression components required by each unit-root test; the combination itself fits no common persistence parameter. Its direct inputs are p values and the count of included units. Approximate ADF p values transmit their own finite-sample and deterministic-specification errors into the combined evidence.

Settings and design choices

Choose individual unit-root method, deterministic terms, lag selection, panel inclusion rules, and dependence correction. Extremely small p values can dominate the sum; numerical implementation should use stable log probabilities rather than silently replacing underflowed values with zero. Different-length series can be used only with individually valid calibration.

Fitting and adaptation

Refit the component tests after changing preprocessing or the panel sample, then recompute the combination. If using dependent-panel resampling, simulate the complete collection of tests under a valid joint null and repeat estimation. Combining p values from whichever specification looks most favorable is not a valid adaptive fitting strategy.

Sensitivity and robustness

Examine contributions by unit, common factors, heterogeneous time coverage, and the distinction between a panel-level rejection and unit-level classification. One exceptionally strong component can reject the joint all-unit null. Follow-up claims about individual stationarity require their own multiplicity-aware analysis rather than reading them off the combined p value.

How to use and calibrate

Combine one-sided unit-root p values using the upper chi-square tail.

Example application

Pool evidence across units with differing lengths or lag structures.

Interpretation and pitfalls

Watch out

This Maddala–Wu procedure is Fisher’s method applied to unit-root tests; it is not an unrelated mathematical test. Rejection does not establish stationarity of the entire panel.

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

Columns are panel units and rows time. Cross-sectional independence and the chosen common/heterogeneous dynamics matter; Hadri reverses the null to stationarity. Choi is represented by the inverse-normal member.

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)
X<-replicate(15,cumsum(rnorm(60)));print(plm::purtest(X,test="madwu",exo="intercept",lags=1))
"""
# 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)
X<-replicate(15,cumsum(rnorm(60)));print(plm::purtest(X,test="madwu",exo="intercept",lags=1))
Output
	Maddala-Wu Unit-Root Test (ex. var.: Individual Intercepts)

data:  X
chisq = 37.673, df = 30, p-value = 0.1583
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 219, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT219.