Hello all,
I would like to test whether there is autocorrelation of the residuals from a poisson regression. I am working with panel data in Stata 13.1. My understanding is that for a nonlinear model with panel data the best way to formally test whether there is autocorrelation of the residuals is to simply regress the residuals on its own lags (no pre-existing package).
My current setup looks something like this:
I have a sense this might be an obvious question, and if so I apologize, but I am unclear on it and would love to have a better understanding of the correct answer and why. I am unsure whether it makes sense to specify the standard errors to be robust to heteroskedasticity when checking for autocorrelation of residuals. That is which of the following is correct:
The R^2 resulting from both regressions is nearly zero suggesting that there is no autocorrelation. However if I look at the p-value or F-statistic the results differ:
Any guidance on which is correct and why would be greatly appreciated.
Best,
Debbie
I would like to test whether there is autocorrelation of the residuals from a poisson regression. I am working with panel data in Stata 13.1. My understanding is that for a nonlinear model with panel data the best way to formally test whether there is autocorrelation of the residuals is to simply regress the residuals on its own lags (no pre-existing package).
My current setup looks something like this:
Code:
xtset v_ijm year poisson y x1 x2 i.v_ij i.v_m i.year, vce(cluster v_ijm) predict y_hat gen resid = y - y_hat
Code:
reg resid L1.resid reg resid L1.resid, vce(robust)
When I do not specify robust SEs the p-value on L1.resid is 0.019 and F(1,116776) = 5.46, suggesting the residuals are autocorrelated.My instinct is that for OLS to be correct I have to correct for the heteroskedasticity in the vector of residuals [resid(1)...(T)] before making any inference or conclusion about autocorrelation. However, I haven't found anything on this topic or similar examples. Further, even if the conclusion is that there is no autocorrelation of the residuals, should I be worried that there seems to be heteroskedasticity in there "residuals of the residuals".
When I do specify robust SEs the p-value on L1.resid is 0.354 and F( 1,116776) = 0.86, suggesting the serial correlation is not a problem.
Any guidance on which is correct and why would be greatly appreciated.
Best,
Debbie
Comment