# SE robust to autocorrelation and testing afterwards

I was running a 2SLS regression with ivreg2 in Stata and I used the Cumby and Huizinga's test for autocorrelation with ivactest -- I found that there was a problem of autocorrelation in the estimation. Then I used the option for autocorrelation consistent standard errors, but running ivactest again it seems the residuals still suffer from autocorrelation.

I would like to know if Cumby and Huizinga's test still 'works' when you already introduced robust SE to deal with autocorrelation, in the sense that you might observe through the test if the autocorrelation problem was correctly dealt with.

Edit:

I'm adding an example from Stata's output just to show that the test changes with the way the standard erros are calculated. I would like to know if Cumby and Huizinga's test still is a valid measure to see if one eliminates the problem of autocorrelation after using autocorrelation consistent standard errors.

use http://fmwww.bc.edu/ec-p/data/wooldridge/phillips.dta, clear

tsset year, yearly
time variable:  year, 1948 to 1996
delta:  1 year

qui ivreg2 cinf (unem = l(1/3).unem), robust bw(auto)

ivactest

Cumby-Huizinga test with H0: errors nonautocorrelated at order 1
Test statistic:  .00817581
Under H0, Chi-sq(1) with p-value:  .92795331

qui ivreg2 cinf (unem = l(1/3).unem)

ivactest

Cumby-Huizinga test with H0: errors nonautocorrelated at order 1
Test statistic:  .01458741
Under H0, Chi-sq(1) with p-value:  .9038666


I'm assuming you used the robust and bw(#) options from ivreg2. Neither of these changes the estimates of the coefficients in your regression, these methods only change the way the standard errors of the coefficients are computed. This means that your residuals are unchanged after specifying robust. If there was autocorrelation in your original residuals, there will still be autocorrelation now.
By the way: actest is a more recent version of ivactest, you can download it using ssc install actest.
• Well, the thing is that the test seems to change if you change the way the standard errors are calculated with ivreg2. I'll add an example in my question. – John Doe Sep 22 '15 at 15:50
• I'm having trouble downloading ivactest from SSC. If I use actest in the example you give, both models give exactly the same results. – Matthijs Sep 22 '15 at 18:17