Announcement

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

  • REGHDFE and tests for serial correlation

    Hello everyone,

    I am using the command REGHDFE by Sergio Correia to estimate FE with three-way error-components. This means: I assume individual, time and school fixed effects, since the educational achievements follow a hierarchical structure.

    My data set contains 8,232 students (i) from 60 schools (j) and 460 classes (c) with a panel data format with T=5 (wave). For each student, I have the test scores (profic_mat) and a list of observed variables ($controlvar) over the time period.

    Code:
    reghdfe Zprofic_mat ZMat_L1 DiD time treated $controlvar, absorb(wave IDescola IDaluno) vce(cluster IDturma)
    and for the IV:
    Code:
    ivreghdfe Zprofic_mat DiD time treated $controlvar (ZMat_L1=L3.Zprofic_mat), absorb(wave IDescola IDaluno) cluster (IDturma)
    My question now is how can I test the model for first-order and second-order serial correlation after the reghdfe estimations?

    I have tried to implement the Wooldridge test (xtserial) after REGHDFE. But this command will ignore the fixed effect and the cluster structure of my model. Similarly, I tried to use the command abar test (Baum, Schaffer, Stillman. Stata Journal 7:4, 2007), but this command may be applied only after regress, ivreg, ivregress and ivreg2. Therefore, I cannot use the abar test with my three-way error-components.


    Any advice would be highly appreciated!
    Last edited by Tharcisio Leone; 25 Feb 2020, 08:35.

  • #2
    Have a look at the community-contributed commands by Jesse Wursten:
    Testing for serial correlation in fixed-effects panel models, Stata Journal 18(1), 76-100.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Dear Sebastian,

      many thanks for your support.
      But the three commands by Jesse Wursten (xtistest, xtqptest,and xthrtest) can be used only after xtreg, and with xtreg I cannot test my model with three-way error-components.

      Comment


      • #4
        If you do not want to use these commands as postestimation commands for xtreg, you can simply predict the residuals from reghdfe and then specify those residuals in the varlist for the test commands.
        https://www.kripfganz.de/stata/

        Comment

        Working...
        X