*! version 1.0.1 21aug2026

Title

gvar unitroot -- unit root tests on the domestic and foreign variables

Syntax

gvar unitroot [, options]

options

maxlag(#) maximum lag order for the augmentation. Default maxlag(4).

ic(string) aic or sbc for choosing the augmentation order.

tests(list) which tests to run: adf, ws, gls, kpss, pp. Default is all.

blocks(list) levels, diff, diff2. Default is levels and first differences.

domestic domestic variables only.

foreign foreign variables only.

level(#) significance level for the rejection marks. Default 95.

summary print the full per-series table rather than the counts.

saving(name) save the results matrix.

Description

gvar unitroot runs the Toolbox's battery on every series in the model:
augmented Dickey-Fuller, the weighted-symmetric ADF of Park and Fuller,
ADF-GLS, KPSS and Phillips-Perron. Each is run on levels, first differences
and, where the block is requested, second differences, for both the domestic
and the foreign variables.

The GVAR treats the variables as I(1) and the foreign variables as I(1) and
weakly exogenous. This command is where you check the first half of that
claim; gvar wetest checks the second.

Options

tests(spec) which tests to run: ADF, weighted-symmetric ADF, ADF-GLS,
KPSS, Phillips-Perron. Omitted, the standard set is run.

They are not interchangeable. KPSS reverses the null -- stationarity rather than a
unit root -- so a series that ADF fails to reject and KPSS also rejects is
telling you the sample is uninformative, not that the series is borderline.

maxlag(#) the maximum augmentation lag. Default 4. ic(string)
selects the criterion used to choose within that maximum.

domestic and foreign restrict the tests to one block or the other. In
a GVAR the foreign variables need to be I(1) for the weak-exogeneity argument to
hold, so both blocks matter and for different reasons.

blocks(spec) groups the output.

graph, gstat(string) and gblock(#) control the plot:
gstat() chooses which statistic is plotted and gblock() which block,
since one chart cannot carry five tests over two blocks legibly.

name(), saving() and nosummary as elsewhere.

Remarks

Reading the output. A well-specified GVAR wants most series
non-stationary in levels and stationary in first differences. Widespread
rejection in levels is a signal that a series may be I(0) and does not belong
in a cointegrating relation; failure to reject in differences suggests I(2)
and needs attention before anything else in the workflow is meaningful.

On the ADF augmentation. The Toolbox's adf.m trims one extra
observation when p = 4. That quirk is reproduced exactly so results match
published output; it is documented in the package inventory.

Examples

. gvar unitroot
. gvar unitroot, tests(adf ws) blocks(levels diff) summary
. gvar unitroot, domestic maxlag(4) ic(sbc)

Stored results

gvar unitroot stores the following in r():

r(urt) the results matrix

r(ic) the information criterion used

r(maxlag) the maximum augmentation order

Source

Toolbox unitroot_tests.m, adf.m, ws.m, detrend.m.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane