*! version 2.0 7 April 2022

Title

xtbunitroot -- Unit root tests for panel data with structural breaks. The tests were developed by Karavias and Tzavalis (2014).

Syntax

xtbunitroot
varname
[if]
[in]
[,trend
known(integer integer)
unknown(numlist integer)
normal
csd
het
nobootstrap
level(integer)
seed(integer)
showindex
]

where varname is the variable to be tested for non-stationarity. You must xtset your data before using xtbunitroot; see [XT] xtset.
If no option is specified, the default will be the model with a single break in the mean at an unknown date, 5% level of test, and seed 123: xtbunitroot varname, unknown(1 100) level(5) seed(123).
varname can contain time-series operators.

Description

xtbunitroot performs panel unit root tests allowing for structural breaks, using the methodology developed by Karavias and Tzavalis (2014).
These tests allow for one or two structural breaks in the deterministic components of the series and can be used in both fixed-T and large-T settings, where T is the number of time series observations in the sample.

The null hypothesis is that all series in the panel are unit root processes. The alternative is that some or all of the series are stationary, with breaks in the deterministic specification (intercepts and trends).
The break dates are common for all units in the panel, but the magnitude of the breaks are unit-specific.

Two models of deterministic components are considered. The first model contains fixed effects only (intercepts) and the second model includes interecepts and linear trends. The dates of the breaks can be known or unknown.
When the dates of the breaks are unknown, a bootstrap procedure is used to calculate the critical and p-values of the test.

The errors can be nonnormal, cross-sectionally dependent and cross-sectionally heteroskedastic.

The panel can be unbalanced.

Options

Model

trend specifies that the deterministic component of the model includes individual intercepts (means) and individual linear trends. The common breaks affect both intercepts and trends.
Breaks in consecutive dates are not allowed in this model. The breaks can be in dates from 3 to T-2, while in the model with intercepts the breaks can take place from 2 up to T-1.

Break

known(break1 break2) specifies the number and places of breaks. This option implements the case when the dates of the breaks are known.
The first input specifies the location of the first break and the second input specifies the location of the second break. If only one break is assumed known(#) can be used.
The inputs should be in terms of time ordering (from 1 to T), instead of using dates i.e. 1995 or 2020. The break dates should be in order.
For example, known(5) means the break occurs in period 5 and known(3 7) means first break occurs in period 3 and second break occurs in period 7.

unknown(numbreaks numboot) specifies the number of breaks and the number of bootstrap replications. This option is used when the dates of the breaks are unknown to the researcher.
The number of bootstrap replications can be omitted. The option unknown(2) states that there are 2 unknown breaks and the critical and p-values will be calculated based on the default number of bootstrap replication which is set to 100.

showindex specifies that the estimated break date is reported as a time index. For example, an estimated break point at the 9th observation will be reported as 9 instead of 2021q4.

Robust

normal specifies that the errors are normally distributed.

csd subtracts the cross-section averages for each time period and applies the tests in the demeaned series.

het specifies that the errors are cross-sectionally heteroskedastic. If both het and normal are specified, the results will be the same as in the case that only normal is used,
because if the errors are normal, then heteroskedastic variances drop out.

nobootstrap prevents the command from running the bootstrap. The bootstrap is necessary for calculating critical values and p-values for the test when the dates of the breaks are unknown.
However, if the dataset is very large then the bootstrap can be time consuming. This option stops the bootstrap but returns the minZ statistic and the estimated break dates.
The minZ statistic can then be compared to the approximate critical values which appear in Table 1 of Karavias and Tzavalis (2014), which is reported in the command output.
This option can be used only together with the option normal because the available critical values are for normally distributed errors.

level specifies the level of the test used. 5% level is the default and all integers between 1 and 99 are applicable. For example, level(10) sets the level of the one-sided null hypothesis to 10%.

seed specifies the seed used in the bootstrap process for the case of unknown breaks. The default is seed(123). Seed is important for reproducing bootstrap-based results.

Examples

The dataset ``xtbunitroot_example.dta'' used in this example is downloadable from
https://sites.google.com/site/yianniskaravias/files/xtbunitroot.

xtset the data

xtset fed_rssd time

Testing the null hypothesis of a random walk against the alternative of stationarity around breaking means, when it is known that the break in the intercepts happened in the 7th time period.
This date corresponds to the quarter ending on March 31, 2020.

xtbunitroot roa, known(7)

Same as above but now we allow for cross-section dependence and cross-section heteroskedasticity.

xtbunitroot roa, known(7) csd het

Two known breaks at dates 7 and 8, that is, in the quarters ending on on March 31, 2020 and on June 30, 2020.

xtbunitroot lev, known(7 8) csd het

Testing the null hypothesis of a random walk with drift against the alternative of trend-stationarity around breaking means and linear trends,
when it is known that the break happened in the 7th time period, which is the quarter ending on March 31, 2020.

xtbunitroot tassets, known(7) trend

Testing the null hypothesis of a random walk against the alternative of stationarity around breaking means, when the date of the break is unknown.

xtbunitroot roa, unknown(1) csd het

Testing the null hypothesis of a random walk against the alternative of stationarity around breaking means, when the date of the break is unknown. The bootstrap replications are set to 50.

xtbunitroot roa, unknown(1 50) csd het

Testing the null hypothesis of a random walk against the alternative of stationarity around breaking means, when the dates of the breaks are unknown.

xtbunitroot nii, unknown(2) csd het

Stored results

xtbunitroot stores the following in r():

Scalars

r(N_g) number of cross sectional units

r(T) number of time periods

r(N) number of total observations

r(breaks) number of breaks

r(break1) time index of the first break

r(break2) time index of the second break

r(seed) seed

r(Z) the Z or minZ statistic

r(pvalue) p-value for the Z or minZ statistic

r(cv) asymptotic or bootstrap critical value

r(boot) number of bootstrap replications

r(fihat) estimate of autoregressive parameter

r(khat) estimate of k

r(shat) estimate of error variance

Macros

r(idvar) name of panel id variable

r(tvar) name of panel time variable

r(varname) name of tested variable

r(model) type of model: constant or constant and trend

r(date1) date of the first break

r(date2) date of the second break

r(avert) average number of time periods

Matrices

r(kui) the individual k for heteroskedastic errors

r(sigmai) the individual variances for heteroskedastic errors

References

Chen, P., Karavias, Y., and Tzavalis, E., 2021. Panel Unit Root Tests with Structural Breaks. Submitted to the Stata Journal.

Karavias, Y., and Tzavalis, E., 2014. Testing for unit roots in short panels allowing for a structural break. Computational Statistics & Data Analysis 76, 391–407. https://doi.org/10.1016/j.csda.2012.10.014

Acknowledgements

xtbunitroot is not an official Stata command. It is a free contribution to the research community. Please cite Chen et al (2021) and Karavias and Tzavalis (2014), as listed in the references above.

Authors

Pengyu Chen

University of Birmingham

Birmingham, UK

cpy1416@outlook.com

Yiannis Karavias

University of Birmingham

Birmingham, UK

i.Karavias@bham.ac.uk