help xtbreak test v. 1.1 - 10. January 2022

Title

xtbreak test - testing for many known and unknown structural breaks in time series and panel data.

Syntax

Testing for known structural breaks:

xtbreak test depvar [indepvars] [if] [in] ,
breakpoints(numlist| datelist [,index|fmt(format)])
options1
options5

breakpoints(numlist[,index]) specifies the time period of the known
structural break.

Testing for unknown structural breaks:

xtbreak test depvar [indepvars] [if] [in] ,
hypothesis(1|2|3)
breaks(#)
options1
options2
options3
options4
options5

hypothesis(1|2|3) specifies which hypothesis to test, see hypothesises.
breaks(#) sets the number of breaks.

Contents

Description

Options

Notes on Panel Data

Covariance Estimator

Saved Values

Examples

References

About, Authors and Version History

Description

xtbreak test implements multiple tests for structural breaks in time series and panel data models.
The number and period of occurrence of structural breaks can be known and unknown.
In the case of a known breakpoint xtbreak test can test if the break occurs at a specific point in time.
For unknown breaks, xtbreak test implements three different hypothesises.
The first is no break against the alternative of s breaks,
the second hypothesis is no breaks against a lower and upper limit of breaks.
The last hypothesis tests the null of s breaks against the alternative of
one more break (s+1).

xtbreak test implements the tests for structural breaks discussed in
Bai & Perron (1998, 2003),
Karavias, Narayan, Westerlund (2021)
and Ditzen, Karavias, Westerlund (2021).

For the remainder we assume the following model:

y(i,t) = sigma0(1) + sigma1(1) z(i,t) + beta0(i) + beta1 x(i,t) + e(it) for t = 1,...,T1

y(i,t) = sigma0(2) + sigma1(2) z(i,t) + beta0(i) + beta1 x(i,t) + e(it) for t = T1+1,...,T2

...

y(i,t) = sigma0(s) + sigma1(s) z(i,t) + beta0(i) + beta1 x(i,t) + e(it) for t = Ts,...,T

where s is the number of the segment/breaks, z(i,t) is a NT1xq matrix containing the variables
whose relationship with y breaks.
A break in the constant is possible if time series data is used.
x(i,t) is a NTxp matrix with variables without breaks.
sigma0(s), sigma1(s) are the coefficients with structural breaks
and T1,...,Ts are the periods of the breakpoints.
beta1 is a px1 vector of coefficients with no breaks.
beta0(i) is a fixed effect (panel data models) or a constant (time series models).

In pure time series model breaks in only the constant (or deterministics) are possible.
In this case sigma0(s) is a constant with a structural break.

xtbreak will automatically determine whether a time series or panel dataset
is used.

Testing a known break point

Assume that the numbers of breaks and their occurrence is known.
xtbreak test can test the breakpoints.
The F-Statistic for the test with s breaks at known dates is:

F(s,q) = dof_adj sigma' R' (R V R')^(-1) R sigma

dof_adj is a degree of freedom adjustment, sigma a matrix containing the coefficient estimates
of sigma, R is the conventional matrix of a Wald test and
V is a variance-covariance matrix.
Under the null F(s,q) is F distributed.
The dof_adj differs for time series and panel datasets.
For the time series case see Bai & Perron (1998, 2003),
for the panel data case see
Karavias, Narayan, Westerlund (2021)
and Ditzen, Karavias, Westerlund (2021)

A known break date can be tested with xtbreak test using the option
breakpoints(numlist|datelist,[index]).
numlist|datelist defines the periods of the breaks.
If numlist is used, then the option index is required.

Testing for unknown break points

If the number and thus the time period of breaks is unknown, xtbreak test
offers three different hypothesises:

No break against s breaks

Formally the hypothesis are:

H_0: no break vs. H_1: s breaks at unknown dates

Bai & Perron (1998) suggest to take the supremum of the
F-Statistics:

supF(s,q) = sup (l1,..,lq) F(l,q)

where l1, lq are the different sets of possible breakpoints.
Essentially the test is the test of a known break after estimation of the breakpoints given a number of breaks.
For a discussion of the estimation of the breakpoints see xtbreak estimate.

The supremum F-Test is called in xtbreak test using the options breaks(#) hypothesis(1).
breaks(#) sets the number of breaks.

Critical values can be found in Bai & Perron (1998, 2003)
and are supplied by xtbreak test.

No break against s0<= s <=s1 breaks

A test of the null hypothesis of no structural change against the alternative that
an unknown number of structural breaks have occurred, where this unknown number of breaks
lies between s0 and s1 is:

H_0: no break vs. H_1: s0 <= s <= s1 breaks at unknown dates

The so-called double maximum test statistic is:

supF = sup(s0,..s,..,s1) supF(s,q)

where supF(s,q) is as defined above.

Generally speaking, the double maximum test estimates the breakdates for each number of breaks
between s0 and s1, calculates the corresponding test statistic and then selects the largest one.
Two versions of the double maximum test are available,
an unweighted and a weighted test.
For the weighted test the test supF(l,q) test statistics are weighted by critical values.

The double maximum test can be used if the options breaks(#) hypothesis(2) are used.
Critical values can be found in Bai & Perron (1998, 2003)
and are supplied by xtbreak test.

s breaks against s+1 breaks

A test of the null hypothesis that, s structural breaks have occurred,
against the alternative that s + 1 breaks have occurred is:

H_0: s breaks vs H_1 s+1 breaks

F(s+1|s) = sup(s=1,..,s+1) sup(s0,..s,..,s1) supF(s,q)

The test is essentially comparing the SSR of the model with s breaks to the minimum of the SSR of the model
with s+1 breaks.

The F(s+1|s) test is integrated in xtbreak test with the options breaks(#) hypothesis(3).
Critical values can be found in Bai & Perron (1998, 2003)
and are supplied by xtbreak test.

Options

breakpoints(numlist| datelist [,index|fmt(format)] specifies the known
breakpoints.
Kown breakpoints can be set by either the number of observation or by the value of the
time identifier.
If a numlist is used, option index is required.
For example breakpoints(10,index) specifies that the one break occurs at the 10th observation in time.
datelist takes a list of dates.
For example breakpoints(2010Q1) , format(tq) specifies a break in Quarter 1 in 2010.
The option format() specifies the format and is required if a datelist is used.
The format set in breakpoints() and the time identifier needs to be the same.

wdmax Use weighted test statistic instead of
unweighted for the double maximum test (hypothesis 2).

level(#) set level for critical values for weighted double maximum test.
If a value is chosen for which no critical values exits, xtbreak test will choose the closest level.

hypothesis(1|2|3) specifies which hypothesis to test, see xtbreak test - unknown break dates.

h(1) test for no breaks vs. s breaks,

h(2) for no break vs. s0 <= s <= s1 breaks and

h(3) for s vs. s+1 breaks.
Default is hypothesis 3.

sequential sequential F-Test to determine number of breaks.
The number of breaks is varied from s = 0 to breaks()-1 or floor(1/trimming).

Saved Values

xtbreak test stores the following in r():

Known Breakpoints

Scalars
r(Wtau) Value of test statistic.
r(p) p-Value from F distribution.

Unknown Breakpoints

Scalars
r(supWtau) Value of supF statistic (hypothesis 1).
r(Dmax) Value of unweighted double maximum test (hypothesis 2).
r(WDmax) Value of weighted double maximum test (hypothesis 2).
r(f) Value of supremum of supF statistic (hypothesis 3).
r(c90) Critical value at 90%.
r(c95) Critical value at 95%.
r(c99) Critical value at 99%.

Matrices
r(breaks) Index and time identifier value of break dates.

Examples

Examples using usmacro.dta

For example we want to find breaks in the
US macro dataset supplied in Stata 16.
The dataset contains quarterly data on the inflation, GDP gap and the federal funds rate.
We load the data in as:

use http://www.stata-press.com/data/r16/usmacro.dta, clear

A simple model to estimate the GDP gap using the federal funds rate and inflation woudl be:

regress ogap inflation fedfunds

Test for known breaks

Assume we want to test for a break in Quarter 1 1970:

xtbreak test ogap inflation fedfunds, breakpoint(tq(1970q1))

and if we want to test for a break in 1970q1 and 1990q4:

xtbreak test ogap inflation fedfunds, breakpoint(tq(1970q1) tq(1990q4))

If we want to test if breaks occurs after 10 and 20 periods:

xtbreak test ogap inflation fedfunds, breakpoint(10 20, index)

Test for unknown breaks

No vs. s breaks

To test hypothesis 1 with for example 3 breaks:

xtbreak test ogap inflation fedfunds, hypothesis(1) breaks(3)

The default is to assume no break in the constant.
To add a break in the constant, the option breakconstant is added:

xtbreak test ogap inflation fedfunds, hypothesis(1) breaks(3) breakconstant

No vs. s0 <= s <= s1 breaks

Hypothesis 2 can be tested with:

xtbreak test ogap inflation fedfunds, hypothesis(2) breaks(3)

The test assumes that under the alternative, there are between 1 and 3 breaks.
To test if there are between 2 and 4 breaks under the alternative:

xtbreak test ogap inflation fedfunds, hypothesis(2) breaks(2 4)

To use the weighted double maximum test we use the option wdmax

xtbreak test ogap inflation fedfunds, hypothesis(2) breaks(2 4) wdmax

Testing s vs. s+1 breaks

Hypothesis can be tested using option hypothesis(3):

xtbreak test ogap inflation fedfunds, hypothesis(3) breaks(2)

To change the minimal segment length to 5%:

xtbreak test ogap inflation fedfunds, hypothesis(3) breaks(2) trimming(0.05)

Examples: Excess deaths in the UK due to COVID 19

An early version of xtbreak test was presented at the 2020 Swiss User Group meeting (see slides here,
NOTE: The examples are on an early version of xtbreak. Results have changed!)
The empirical example was on the question if can we identify structural breaks in the excess deaths in the
UK in 2020 due to COVID19?
Data from Office of National Statistics (ONS) for weekly deaths in the UK for 2020 was used.
The data can be downloaded here.

To test for an unknown breakdate with up to for breaks:

xtbreak test ExcessDeaths , breakconstant breaks(1 4) hypothesis(2)

We can test if there is a break in weeks 13 and 20 against the
hypothesis of no break.

xtbreak test ExcessDeaths , breakconstant hypothesis(1) breakpoints(13 20, index)

Using a HAC consistent estimator rather than the SSR.

xtbreak test ExcessDeaths , breakconstant hypothesis(1) breakpoints(13 20, index) vce(hac)

Test for 2 breaks at unknown dates:

xtbreak test ExcessDeaths , breakconstant breaks(2) hypothesis(1)

Test for 1 vs. 2 breaks:

xtbreak test ExcessDeaths , breakconstant breaks(1) hypothesis(3)