Announcement

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

  • New packages: xthst - testing for slope homogeneity

    Thanks to Kit Baum a new package is available on SSC. xthst tests for slope homogeneity in large panels.

    xthst performs a test of slope homogeneity in panels with a large number observations of the cross-sectional (N) and time (T) dimension. The test is based on Pesaran, Yamagata (2008, Journal of Econometrics) and Blomquist, Westerlund (2013, Economic Letters). The null hypothesis of the test is of homogeneous slopes, implying that all slope coefficients are identical across cross-sectional units. xthst can be used for both balanced and unbalanced panels, supports strictly and weakly exogenous regressors, cross-sectional dependence and serial correlated errors.

    The syntax is:

    Code:
    xthst depvar indepvars [if] [,partial(varlist_p) noconstant ar hac bw(integer) whitening kernel(qs|bartlett|truncated) crosssectional(varlist_cr [,cr_lags(numlist)]) nooutput ]
    where varlist_p are variables to be partialled out and varlist_cr variables added as cross-sectional averages.

    Examples:
    When regressing x on y, test if x has heterogeneous slope coefficients:
    Code:
    xthst y x
    If the errors are serially correlated, use the HAC consistent version based on Blomquist, Westerlund (2013, Economic Letters):
    Code:
    xthst y x, hac
    In a multivariate model it is possible to test a subset of regressors:
    Code:
    xthst y x1 x2, partial(x2)
    The test works well if the underlying model is an AR(p):
    Code:
    xthst y L1.y L2.y , ar
    For more information and examples, please see the help file.

    xthst is a joint project with Tore Bersvendsen (University of Agder).


  • #2
    Thanks to Kit Baum a new version of xthst is available on SSC. The new version has the following updates:
    • Speed Improvements
    • Bug fixes in small sample adjustment
    • Bug in first autocorrelation when option HAC was used
    For more information and examples, please see the help file.

    xthst is a joint project with Tore Bersvendsen (University of Agder).

    Comment


    • #3
      Hi Jan,

      First of all, thank you for contributing a very useful package.

      I have a more general question (apologies if it is way too obvious): say that I have a dynamic ARDL(1,1) model -with N=30, T=50- and because of the presence of strong CSD, I want to estimate the long-run coefficients using the ECM approach. My question is the following: in order to test for slope homogeneity, I tested the long-run (level) equation and then formulated and estimated the ECM. Is this the correct approach or should the test be applied to the ECM?

      Many thanks in advance.

      Comment


      • #4
        Dear George,
        thank you very much for your interest in our package. Your question is actually very interesting and something my co-author and I discussed for at some point but never looked into.

        First of all let me clarify, you use the ECM because you are interested in the short and long run coefficients? You need to add cross-sectional averages because you find strong cross-sectional dependence. However the dimensions of your panel, in particular the cross-sectional dimension is relatively small. Which estimation command do you use for the estimation itself?

        To the best of my knowledge there is no literature on the exact issue of your question. Pesaran and Yamagata only build a test for a simple AR model, not for an ARDL model. As an alternative, you can follow the approach in Blackburn and Frank (2007, Stata Journal (7):2) and do a Hausman test. This test would test the entire model though. However as Tore and I lined out (and so Pesaran and Yamagata), the Hausman test has its flaws in panels with large N and large T.

        What is the best thing you can do? My take is to test the entire model, i.e. add the short run coefficients as well. Since you are only interested in the long-run coefficients, you partial out the short run coefficients using the partial option in xthst. An example would be then:

        Code:
        xthst d.y L.y L.x , partial(d.x) cr(y x)
        Since the long run coefficient on x would be _b[L.x]/_b[L.y], if both are heterogeneous, the long run coefficients should be heterogeneous. The caveat is of course, it is hard to detect if - say _b[L.y] is homogenous and _b[L.x] is heterogeneous. As there is no theory backing this approach, I would experiment with the ar option, add L.x and L.y to the partialled out variables and test the robustness of the results allowing for homo- and heterogeneous slopes.

        Hopefully this helps. Please let me know if you have any further questions.

        Cheers,

        Jan

        Comment


        • #5
          Hi Jan,

          First of all, many thanks for the detailed reply.

          Yes, I use the ECM because I need both long- and short-run estimates [and, to some extent, the adjustment coefficients as well, as an indication of the half-life of a shock]
          .
          As I am working with a macroeconomic panel [OECD countries] strong cross-sectional dependence is almost always gonna be there, given that the 2008 crisis period is included - I verified it using your xtcd2 command for the Pesaran (2015) test.

          Thing is, with macro panels there is always a trade-off between N and T, especially if you look at public finances data. I know that 30-35 countries is not all, but...

          I used your xtdcce2 command, in order to compare the MG and the DCCE-MG results, to highlight the need of accounting for CSD when assessing public finances - interestingly, there are cases where I cannot accept the null of weak CSD, even though the statistics is significantly reduced compared the standard MG case. I also played around a bit with CS-DL and CS-ARDL but didn't really work.

          I had no idea that there is no theory backing this - somehow it made sense to me to test the EC model, but wasn't sure at all, and I could not justify it. I was just basing in on macroeconomic considerations (e.g. you do expect that, say, expenditures will have heterogeneous impacts across countries for a number of institutional and other reasons, especially in the `long-run')

          Best,
          G.

          Comment


          • #6
            Hi George,
            I think this is going to be a bit off topic, but I bet there is some interest and it coincides with some work I am doing at the moment.

            My feeling with the CD test is, don't pay too much attention to the significance. Especially in larger panels the CD seems to have a larger size than desirable (i.e. you falsely reject the null hypothesis). If the inclusion of cross-sectional averages drives down the CD test statistic and the coefficients of interest remain the same, my recommendation is then that you are fine.

            What did not really work with CS-DL and CS-ARDL estimator?

            Finally, my statement about no theory for testing slope homogeneity for ARDL models applies to the special case of large N, large T dynamic models with cross-sectional dependence. For other settings, there are tests available (such as the Hausman test etc.).

            Hope this helps.

            Jan

            Comment


            • #7
              Hi Jan,

              You are right, it is off topic but again, many macro people will find it useful i feel.

              That's what I have observed in the macro panels that I have worked with - significant reduction in the CD statistic compared to the non-augmented models.

              It wasn't something with the routine or anything - bad phrasing is all. I just had to try a number of alternative lags and in the end it felt a bit like `data mining', if that makes sense.

              Yeah, I got that about the theory

              I wont hijack the thread even more :P
              Many thanks for the help - it is greatly appreciated.

              Best,
              G.

              Comment


              • #8
                Thanks to Kit Baum a new version of xthst is available on SSC. The new version has the following updates:
                • Option comparehac was added. comparehac compares the standard delta test and the HAC robust next to each other. A message is posted if the results differ. It also tests for cross-sectional dependence if xtcd2 is installed.
                • When the option nooutput was used, some results were not posted to r(). This is fixed.

                For more information and examples, please see the help file.

                xthst is a joint project with Tore Bersvendsen (University of Agder).

                Comment


                • #9
                  Thanks to Kit Baum a new version of xthst is available on SSC. The new version (v 1.4) fixes a bug when using cross-sectional averages.

                  For more information and examples, please see the help file.

                  Comment

                  Working...
                  X