Menu

#97 cross-sectional dependence test

None
closed
nobody
None
5
2020-10-27
2016-08-04
KTTK
No

It seems, gretl misses tests for cross-sectional dependence, e.g. Breusch/Pagan LM Test (also scaled) and Pesaran's CD Test (see Pesaran (2004)). The only hit for a search for gretl and cross-sectional dependence I found it this (unanswered) mail from gretl-users mailing list:
http://lists.wfu.edu/pipermail/gretl-users/2010-December/005630.html

Also, there is no function package for this type of test. Would be good to have these tests available in gretl.

Discussion

  • Sven Schreiber

    Sven Schreiber - 2016-08-05

    Am 04.08.2016 um 19:07 schrieb KTTK:

    It seems, gretl misses tests for cross-sectional dependence, e.g.
    Breusch/Pagan LM Test (also scaled) and Pesaran's CD Test (see
    Pesaran (2004)).

    Yes, cross-sectional dep. (CSD) is a topic which I also find important.
    In principle these formulas are pretty easy, the most challenging part
    is to handle the data in the unbalanced panel case. I have a first
    prototype function for the two tests that you mention (only the scaled
    version of the LM test). This could evolve into a function package
    fairly quickly.

    Are you on one of the gretl mailing lists? I'm not sure the discussion
    with lengthy code examples should be carried out here on the tracker.
    Although we could try, why not -- maybe there's also an attachment
    feature somewhere (right now I'm not using the web interface but doing
    this via email reply).

    cheers,
    sven

     
  • KTTK

    KTTK - 2016-08-05

    I am not on the list (anymore). Unfortunately, I cannot really be of help here because I do have neither hansl nor C skills. My post was really more of a hint/feature request.

    As a benchmark, you can look at R's plm (make sure to use the development version), EViews 9.5 (also make sure to not use an earlier version) or Stata (at least for some tests).

     

    Last edit: KTTK 2016-08-05
    • Sven Schreiber

      Sven Schreiber - 2016-08-05

      Am 05.08.2016 um 17:47 schrieb KTTK:

      I am not on the list (anymore). Also, I cannot really help there
      because I do not have neither hansl nor C skills. My post was really
      a like a feature request.

      OK, let's keep it on the tracker then. And I didn't mean that you have
      to develop the package, I'll do it. I just thought that you could do
      some testing.

      As a benchmark, you can look at R's plm (make sure to use the
      development version), EViews 9.5 (also make sure to not use an
      earlier version) or Stata (at least for some tests).

      I do have Eviews 9.5 and will cross-check with that. But can you tell me
      why you're saying no earlier version? Were the tests wrong or simply not
      there?

      thanks,
      sven

       
  • KTTK

    KTTK - 2016-08-05

    About EViews: In some former version they had the CD tests only as a (possibly) user-supplied add-in and that gave wrong test statistics for some time (also they spelled Pesaran as Pearson there...), see http://forums.eviews.com/viewtopic.php?t=8109

    The add-in had more/other tests compared to the now official incorporated tests in EViews, e. g. Frees' test (but that one is in Stata xtcsd).

    A hint would be to use the first 100 lines of the Grunfeld data for comparision (most p-values are != 0 for that data, allowing for better comparison). And then also make an unbalanced version of that data.

     

    Last edit: KTTK 2016-08-05
    • Sven Schreiber

      Sven Schreiber - 2016-08-07

      Am 05.08.2016 um 18:17 schrieb KTTK:

      About EViews: In some former version they had the CD tests only as a
      (possibly) user-supplied add-in and that gave wrong test statistics
      for some time (also they spelled Pesaran as Pearson there...), see
      http://forums.eviews.com/viewtopic.php?t=8109

      Ok, thanks. I've also noticed now that eq 44.29 in the Eviews 9.5 help
      contains a typo. (missing root over the T_ij)
      So I've already got Pesaran's statistic alright in my code. The others
      still need some checks. Due to the holiday season a (preliminary)
      function package is probably going to take another two weeks.

      cheers,
      sven

       
  • Sven Schreiber

    Sven Schreiber - 2016-10-29
    • status: open --> closed
     
  • Sven Schreiber

    Sven Schreiber - 2016-10-29

    This is now implemented in core gretl by Allin (development version, to become version 2016d) as modtest ... --xdepend. Thanks for the suggestion.

     
  • KTTK

    KTTK - 2016-11-02

    This is great news, thank you guys!

    How do you think about implementing the LM [1] and scaled LM [2] test for cross sectional dependence as well? Should be pretty easy to compute those once the components for Pesaran's CD statistic are there. However, I am not sure if those are used widly in applied econometrics...

    [1] Breusch, T.S. and A.R. Pagan (1980), The Lagrange multiplier test and its applications to model specification in econometrics, Review of Economic Studies, 47(1), pp. 239–253.

    [2] Pesaran, H. (2004), General Diagnostic Tests for Cross Section Dependence in Panels, CESifo Working Paper 1229.

     
    • Sven Schreiber

      Sven Schreiber - 2016-11-02

      Am 02.11.2016 um 10:21 schrieb KTTK:

      How do you think about implementing the LM [1] and scaled LM [2] test
      for cross sectional dependence as well? Should be pretty easy to
      compute those once the components for Pesaran's CD statistic are
      there. However, I am not sure if those are used widly in applied
      econometrics...

      I think there should be a good econometric reason to offer other tests.
      The standard way in gretl is to have one "modtest" variant per topic, as
      in "modtest --autocorr" for example. (But I admit there are some
      exceptions.)
      I am not up to date on the literature in that area, is there a consensus
      that the other tests are better (at least in some relevant situations)?

      Apparently I wrote that I had already started programming (in hansl)
      other test statistics, but to be honest right now I cannot remember
      anything about that. (Although it's probably still lying around on my
      hard disk.)

      thanks,
      sven

       
  • KTTK

    KTTK - 2016-11-10

    As I wrote, not sure about what is used in the wild and if the statistics (their properties) differ substantially. The user-written Stata module xtcsd offers Friedman's test and Frees' test besids Pesaran's CD test:
    http://fmwww.bc.edu/RePEc/bocode/x/xtcsd.html

     

Log in to post a comment.

MongoDB Logo MongoDB