Announcement

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

  • Obtaining 1. Predicted Values, 2. Residuals from an xtlogit


    Hello all,

    I try to obtain the predicted probabilities from a logit model.

    Since I have not found anything by searching, I came up with this:

    xtlogit X control_variables instruments if condition > 12, vce(bootstrap)
    predict probability, xb
    by id year: gen residuals = X - probability

    The reason I do this is that I would like to follow the procedure proposed by Wooldridge:

    xtlogit X exogenous_controls instruments
    predict probability
    xtivreg Y exogenous_controls (X = probability)

    ,where U is the outcome of interest and Y is the Treatment. In the original version, Wooldridge proposes a Probit Model and its not for the panel case.

    (referenced to here: https://www.stata.com/statalist/arch.../msg00339.html)
    Source:
    Jeffrey M. Wooldridge, Econometric Analysis of Cross Section and Panel Data, MIT Press, 2002.

    Here is the full model I would like to estimate on Cross-Validated, but I do not think Statalist would be appropriate to ask the question:
    https://stats.stackexchange.com/ques...ion-term-endog

  • #2
    Code:
    predict probability, xb
    is either an error, or an odd (no pun intended) name for a variable that will contain the predicted log odds, not the predicted probability. If you want this variable to actually contain the predicted probability, it would be
    Code:
    predict probability, pr // TAKING THE RANDOM EFFECT INTO ACCOUNT
    // OR
    predict probability, pu0 // CONDITIONING ON RANDOM EFFECT = 0

    Comment


    • #3
      Hello Clyde,

      Thank you for answering your post was very helpful!

      As you rightly point out this was a mistake. Since I usually do not use these kind of models, I thought the Wooldridge approach would actually mean to predict the log odds and use them subsequently. This seems not to be the case.

      The command for the residuals (meaning with log odds), is this one correct?

      Comment


      • #4
        Let me be clear: I am not familiar with Wooldridge's model. Jeff Wooldridge himself posts frequently on this Forum, and it would surprise me if he does not chime in.

        I simply noted the oddity of calling the variable probability when it contains the log odds. As for residuals, if you go
        Code:
        predict probability, pr // OR pu0
        gen residual = X - probability
        you will have a variable that is sensibly named and whose value represents the difference between observed and some species of predicted probability. (These are sometimes called Pearson residuals.)

        If, however, you calculate X minus the predicted log odds, you will have a variable that I would be at a loss to describe, or find meaning in. Even without knowing Wooldridge's model, I feel reasonably confident that X - predicted log odds would not play any role in it. I am unable even to imagine any model of anything that would use that calculation. But, as noted, I don't actually know this model so I can't be 100% certain here.

        Comment


        • #5
          Again thank you very much. I now have a starting point on which I can build upon. I think most likely that the 3-Step procedure proposed by Jeff Wooldridge uses the predicted probability as outlined. So I am gonna read up on the theory part first.

          Comment

          Working...
          X