Announcement

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

  • Residual and standardized residuals after xtlogit

    Pls, can someone help me with the Stata command or guide on how to generate residual and standardized residuals after I ran an xtlogit regression? for instance; xtlogit y x1 x2 x3 x4 x5 x6 xk, re nolog
    where y is the dependent variable and x1 toxk are the independent variables. Your response is highly appreciated.

    Thank you in advance


    Adamu

  • #2
    First a caution: the residuals calculated after a logistic regression cannot properly be used in all of the same ways that one might use residuals after a linear regression. So be thoughtful about how you use these.

    To calculate a residual after the command shown in #1::

    Code:
    predict mu, mu
    gen residual = y - mu
    To my knowledge, there is no agreed upon definition of standardized residuals after a random effects logistic model: does one standardize within panel, or overall? If I have this wrong, I hope somebody will speak up.

    Comment


    • #3
      Clyde:
      Thank you for the response. I tried it but this what I got

      predict mu, mu
      option mu not allowed
      r(198);

      When I removed the option, i got an output like this
      predict mu
      (option xb assumed; linear prediction)

      Pls, one more question, can you help me with an article or textbook that I can use as a backup the caution you mentioned?

      First a caution: the residuals calculated after a logistic regression cannot properly be used in all of the same ways that one might use residuals after a linear regression. So be thoughtful about how you use these.
      .


      Thank you once again.

      Adamu

      Comment


      • #4
        Sorry, mu was an error on my part. But xb is not correct either. It should be:

        Code:
        predict pr, pr
        gen residual = y - pr
        I think it is hard, if not impossible, to find a reference for not doing something. The point is that if you want references to back up what you are doing, look for them. If you try to do something for which these residuals are unsuitable, you won't find any support for doing it.

        Comment


        • #5
          Cylde:
          Thank you very much. Very helpful remark.

          Comment

          Working...
          X