Announcement

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

  • Autocorrelation in Random-Effects logit model (unbalanced panel data)

    Hello,

    I have an unbalanced panel dataset. I am running a Random-Effects logit model in Stata (command: xtlogit Y X1 X2 ... , re). My dependent variable "Meat" is binary (1 = if the individual consumed meat during the eating episode; 0 = otherwise). I would like to test for autocorrelation on this binary variable "Meat".

    Please, could you tell me which test / command can I use to do that?

    Thank you in advance!
    Kind regards,

    Helena

  • #2
    Helena:
    welcome to this forum.
    Yopu might be interested in How can I test for autocorrelated errors in logistic regression? - Cross Validated (stackexchange.com)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thank you for your reply. However, after reading the related links you attached in your response it is still not clear to me which test can I use to check for autocorrelation on my dependent binary variable (after running a Random Effects logit model on panel data, as I mentioned earlier).

      I would really appreciate if you could just tell me whether or not a test / command in Stata exists to check for autocorrelation in this case, and if yes, which one would it be.

      I thank you again for your time.

      Sincerely,

      Helena.

      Comment


      • #4
        Helena:
        1) autocorrelation relates to residual distribition, not predictors;
        2) testing ofr autocorrelation in non-linear (panel data) regression is a tricky issue: see Testing for autocorrelation in a logistic regression analysis with panel data - Statalist.
        Basically, I'd recommend you to run your regresssion with default and clustered standard errors and see if any relevant difference in the standard errors creeps up (it's more a matter of art and experience than clear-cut methodology, I know... )
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Helena:

          I would just use regular logit and cluster your standard errors. If you use random effects logit, you're assuming the heterogeneity is uncorrelated with the covariates, anyway. If you use pooled logit then you're assuming the same thing, but pooled logit works for any kind of serial correlation.

          If you find serial correlation in the shocks in RE logit then the estimator is, technically, inconsistent. So clustering your standard errors with RE logit has a logical problem. I think it's still sensible to use vce(cluster id) after RE logit, but you're admitting the estimators are inconsistent.

          Code:
          xtset id year
          logit y x1 ... xk i.year, vce(cluster id)
          As Carlo said, it's tricky to test for serial correlation in the underlying errors because the model is y(i,t) = 1[x(i,t)*b + c(i) + e(i,t)] where 1[.] is the indicator function. Testing for serial correlation in e(i,t) is not trivial and I don't know that the proper test has been developed. But you can use ignore c(i) (since it's being assumed uncorrelated with x(i,t)) and use pooled logit as above.

          Comment

          Working...
          X