Announcement

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

  • xtqptest: a test for serial correlation in a fixed effects setting

    Dear all

    I have implemented to Born & Breitung (2016) bias-corrected LM-based test for serial correlation. It takes the combined residuals (fixed effect + idiosyncratic error; option ue in predict) as input and returns the Q(p) statistic described on page 1303 of aforementioned paper, as well as the corresponding p-values.

    It takes on option p, which is the order up to which should be checked for serial correlation. E.g. if p = 3, the null hypothesis is H0: No serial correlation up to order 3. If it is not specified, I set the default to 2 (somewhat arbitrarily).

    Example usage
    Code:
    sysuse xtline1, clear
    xtreg calories, fe
    predict ue, ue
    xtqptest ue
    xtqptest ue, p(1)
    Output is at the bottom of this post.

    Any comments or criticisms before I forward this to ssc? In addition, any idea what the lowest Stata version would be on which this works? I've tried an earlier version on Stata 12 and that worked.

    Cheers
    Jesse

    References
    Testing for Serial Correlation in Fixed-Effects Panel Data Models, Benjamin Born and Jörg Breitung, Econometric Reviews 2016
    http://www.tandfonline.com/doi/abs/1...38.2014.976524

    Click image for larger version

Name:	xtqptest.png
Views:	1
Size:	30.5 KB
ID:	1352391

    Attached Files

  • #2
    Three updates

    1. Supports use of if/in
    2. Now checks for balancedness of panel and whether the residuals look as if they include the fixed effect (which they should) by checking the standard deviation/min/max of the mean residual per panel unit. (Will all be zero if they used standard residuals e_it)
    3. Added option "force" to overrule the above checks.
    Attached Files

    Comment

    Working...
    X