Announcement

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

  • Testing for Autocorrelation in Residuals of Poisson Regression

    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:
    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
    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:
    Code:
    reg resid L1.resid
    reg resid L1.resid, vce(robust)
    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:
    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.

    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.
    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".

    Any guidance on which is correct and why would be greatly appreciated.

    Best,
    Debbie


  • #2
    Dear Debbie,

    I am afraid your test may not be valid. While it should be fairly straightforward to obtain a test for serial correlation in this context, I am not aware of any such test. I would just use clustered standard errors.

    Best wishes,

    Joao

    Comment


    • #3
      Debbie: I think Joao offers great advice. If you want to explore such issues in greater depth, I would suggest this paper https://www.tandfonline.com/doi/abs/...nalCode=lsta20

      Comment


      • #4
        Dear Joao and John,
        Thank you both so much for your reply. If I understood the paper correctly it seemed to suggest that the poisson maximum likelihood will be consistent in the presence of serial correlation as long as the the mean function is properly specified; even with panel data.

        And it seems like you both agree with the following recommended action (though please correct me if I've misinterpreted):

        There is no good way to formally test for serial correlation of residuals of the poisson model with panel data. Therefore, I should simply assume that serial correlation is a problem, and cluster the standard error of the primary poisson regression at the panel level.

        Code:
        xtset v_ijm year
        poisson y x1 x2 i.v_ij i.v_m i.year, vce(cluster v_ijm)
        This allows for the residuals to be correlated within that panel, v_ijm, (essentially allowing for serial correlation) and thus resulting theoretically in an unbiased and consistent estimator?

        All the best,
        Debbie

        Comment


        • #5
          Dear Debbie,

          That is almost right, but the estimator will not be unbiased. In addition to the important reference John provided, you may also want to have a look at

          Wooldridge, J. M., “Distribution-Free Estimation of Some Nonlinear Panel Data Models,” Journal of Econometrics 90 (1999), 77–97.

          Best wishes,

          Joao

          Comment


          • #6
            I think I've got it, thank you very much for the clarification. I will take a look at this second paper as well.

            Best,
            Debbie

            Comment

            Working...
            X