Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • New package: xtbreak - module for detecting and dating multiple structural breaks in time series and panel data

    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:

    Code:
    xtbreak y x , options
    To estimate the location of the breaks knowing the number of breaks:

    Code:
    xtbreak estimate y x, breaks(#) options
    Testing the location of known breakpoints:

    Code:
    xtbreak test y x, breakpoints(#, index|fmt(format) options
    and finally to test for unknown breaks using one of the three hypothesis from above:

    Code:
    xtbreak test y x, breaks(#) hypothesis(1|2|3) options
    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:

    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
    -------------------------------------------------------------------------------
    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


  • #2
    A new version of xtbreak is available - please update! The update can be found on our GitHub page and can be installed in Stata via

    Code:
    net install xtbreak, from(https://janditzen.github.io/xtbreak/)
    The new version will be available on SSC in the next days.

    The update contains:
    • fix when name of dependent variable included test
    • error in scaling critical values and test statistic when using hypothesis 3
    • minimum and maximum number of breaks are now displayed when using the sequential test.
    Due to the bug in the scaling of the critical values and the test statistic, results can change. We therefore strongly recommend to update xtbreak to the latest version and check results!

    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


    • #3
      Hi@JanDitzen, Many thanks for sharing such the useful information, I greatly appreciate your works. I would like to ask that how can we test for structural break in case of many independent variables?. Should we test one by one (x) with dependent variable (y) ? Many thanks.

      Comment


      • #4
        Do you know which variables are breaking? In any case, you can add variables which are not breaking using the option nobreak(). My suggestion would be, you add those variables you know are not breaking into the option nobreak and then test/estimate the breaks.

        Comment


        • #5
          Great, I got it. Many thanks @JanDitzen

          Comment


          • #6
            Greetings, I tried a nobreak()option for multiple breaking variables but it gives me "option nobreak() not allowed" error, can i have a full procedure?

            Comment


            • #7
              The option is called nobreakvariables but can be abbreviated. Can you please make sure you have the latest version from Github:

              https://janditzen.github.io/xtbreak/

              Comment


              • #8
                Thanks to Kit Baum a new version of xtbreak is available on SSC and GitHub.

                Version 2.0 comes with a lot of new features. Among them:
                - support for unbalanced panel
                - Python option to improve speed when working with long time series
                - Several major updates and bug fixes.

                The paper describing the article will be updated this night on arXiv.

                The article describing the panel methods is published published in the Journal of Applied Econometrics.

                Comment

                Working...
                X