I am excited to announce a new package on SSC (thanks to Kit Baum): xtbreak.
xtbreak provides researchers with a complete toolbox for analysing multiple structural breaks in time series and panel data as discussed in Bai & Perron (1998, 2003), Karavias, Narayan, Westerlund (2021) and Ditzen, Karavias, Westerlund (2021). xtbreak can detect the existence of breaks, determine their number and location, and provide break date confidence intervals. The number and period of occurrence of structural breaks can be known and unknown. In the case of a known breakpoint xtbreak can test if the break occurs at a specific point in time. For unknown breaks, three different hypothesises are implemented. 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 requires Stata 15.1 or newer. It can be applied to time series and balanced panel data.
The details of the package including more background information on the econometric methods, syntax and examples is available as a working paper and on our GitHub page. Updates will be continuously rolled out via GitHub and less frequent via SSC.
A few more details on the syntax and an example. The syntax to estimate the number of breaks and their location without any prior knowledge is:
To estimate the location of the breaks knowing the number of breaks:
Testing the location of known breakpoints:
and finally to test for unknown breaks using one of the three hypothesis from above:
Example: We want to find out if the (simplified) relationship between COVID19 cases and number of deaths due to COVID19 in the US has changed:
We find two breaks, one in week 20 of 2020 and the other in week 11 in 2021.
If you have any comments or questions, please do not hesitate to get in touch with us either here, on our GitHub page or via Mail.
Thanks!
Jan
xtbreak provides researchers with a complete toolbox for analysing multiple structural breaks in time series and panel data as discussed in Bai & Perron (1998, 2003), Karavias, Narayan, Westerlund (2021) and Ditzen, Karavias, Westerlund (2021). xtbreak can detect the existence of breaks, determine their number and location, and provide break date confidence intervals. The number and period of occurrence of structural breaks can be known and unknown. In the case of a known breakpoint xtbreak can test if the break occurs at a specific point in time. For unknown breaks, three different hypothesises are implemented. 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 requires Stata 15.1 or newer. It can be applied to time series and balanced panel data.
The details of the package including more background information on the econometric methods, syntax and examples is available as a working paper and on our GitHub page. Updates will be continuously rolled out via GitHub and less frequent via SSC.
A few more details on the syntax and an example. The syntax to estimate the number of breaks and their location without any prior knowledge is:
Code:
xtbreak y x , options
Code:
xtbreak estimate y x, breaks(#) options
Code:
xtbreak test y x, breakpoints(#, index|fmt(format) options
Code:
xtbreak test y x, breaks(#) hypothesis(1|2|3) options
Code:
use https://github.com/JanDitzen/xtbreak/raw/main/data/US.dta xtbreak deaths L1.cases Sequential test for multiple breaks at unknown breakpoints (Ditzen, Karavias & Westerlund. 2021) ----------------- Bai & Perron Critical Values ----------------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value -------------------------------------------------------------------------------- F(1|0) 107.50 12.29 8.58 7.04 F(2|1) 31.25 13.89 10.13 8.51 F(3|2) 6.96 14.80 11.14 9.41 F(4|3) 1.18 15.28 11.83 10.04 F(5|4) 4.95 15.76 12.25 10.58 -------------------------------------------------------------------------------- Detected number of breaks: 2 2 2 -------------------------------------------------------------------------------- Number indicate highest number of breaks the null hypothesis is rejected. Estimation of break points T = 82 SSR = 226.85 -------------------------------------------------------------------------------- # Index Date [95% Conf. Interval] -------------------------------------------------------------------------------- 1 16 2020w20 2020w19 2020w21 2 59 2021w11 2021w9 2021w13 -------------------------------------------------------------------------------
If you have any comments or questions, please do not hesitate to get in touch with us either here, on our GitHub page or via Mail.
Thanks!
Jan
Comment