*! version 1.0.0 03jul2026

Title

tsadvroot npadf -- Unit-root test with two structural breaks at
unknown dates (Narayan and Popp 2010)

Syntax

tsadvroot npadf varname [if] [in]
[, options]

model(string) 1 (M1: two breaks in the level) or
2 (M2: two breaks in level and slope); default model(1)

pmax(#) maximum lag of D.varname; default
pmax(8)

ic(string) lag selection per break pair: aic, sic
or tstat (default, the source default)

trim(real) trimming fraction for the break search; default
trim(0.10) (the source's coded default)

graph plot the series with the estimated break dates

name(string) graph name

noprint suppress the results table

The data must be tsset, contiguous within the sample.

Description

tsadvroot npadf implements the Narayan and Popp (2010) ADF-type
unit-root test allowing for two structural breaks at unknown dates. Model M1
allows two breaks in the level of a trending series; model M2 allows two
breaks in both the level and the slope. The break dates are those that
minimize the ADF t-statistic over a two-dimensional grid, and the reported
statistic is the minimized t-ratio on y_t-1. Critical values are from
Narayan and Popp (2010, Table 3) and depend on the sample size.

Options

model(1) (aliases a, level, m1) or model(2)
(aliases c, both, m2).

ic(): for each candidate break pair, the lag order is re-selected
by the chosen criterion, exactly as in the source (aic/sic with
the tspdlib (k+2) penalty, tstat = general-to-specific with
|t| > 1.645).

trim(): the grid runs from max(3+pmax, ceil(trim x T)) to
min(T-3-pmax, floor((1-trim) x T)), with the second break at least 2
(model 1) or 3 (model 2) periods after the first.

Methods and formulas

For each candidate pair (TB1, TB2) the test regression is

D.y_t = rho y_t-1 + z_t-1' gamma + sum_j phi_j D.y_t-j + e_t

with z = (1, t, DU1, DU2) in M1 and z = (1, t, DU1, DU2, DT1, DT2) in M2,
where DU_i,t = 1(t > TB_i) and DT_i,t = (t - TB_i) 1(t > TB_i). Note that
the deterministic terms enter lagged (z_t-1), following the NP test
equation derived from their innovational-outlier DGP. The statistic is the
t-ratio on rho at the break pair that minimizes it.

Source compatibility (narayan pop.src)

The following source conventions are reproduced exactly:

- the linear trend is included in both models;

- deterministics enter lagged one period;

- default trimming is 0.10 (the coded dynargsGet default; the
source's comment header mentions 15%, but the code default is 10%);

- effective grid bounds: because GAUSS symbols are case-insensitive,
T1/t1 and T2/t2 in the source are the same
variables; the operative bounds are T1 = max(3+pmax, ceil(trim T)) (raised
to pmax+3 if below pmax+2) and T2 = min(T-3-pmax, floor((1-trim) T));

- minimum separation between breaks: 2 periods in M1, 3 in
M2;

- lag re-selected at every break pair; AIC/SIC use the (k+2)
penalty; the reported lag is the one at the minimizing pair;

- critical values switch at T = 50, 200, 400 (NP Table 3).

The reported break dates TB1 and TB2 are the last period of the
pre-break regime: the break dummies switch on strictly after TB.

Stored results

Scalars

r(stat) minimized ADF statistic

r(tb1), r(tb2) break dates (time-variable units)

r(tb1pos), r(tb2pos) break positions (1..T)

r(frac1), r(frac2) break fractions

r(lags) selected lag order at the optimum

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

r(T) sample size

Macros

r(cmd), r(varname), r(model), r(ic),
r(breakdates)

Examples

. webuse air2, clear

. gen lair = ln(air)

. tsadvroot npadf lair, model(1) graph

. tsadvroot npadf lair, model(2) pmax(4) ic(sic) trim(0.15)

. di r(stat) " breaks at " r(tb1) " and " r(tb2)

References

Narayan, P. K., and S. Popp. 2010. A new unit root test with two structural
breaks in level and slope at unknown time.
Journal of Applied Statistics 37: 1425-1438.

Narayan, P. K., and S. Popp. 2013. Size and power properties of structural
break unit root tests. Applied Economics 45: 721-728.

Author

Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane

Also see

Help: tsadvroot, tsadvroot_qadf, tsadvroot_fqadf,
tsadvroot_cisur