Announcement

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

  • Predicted probabilities

    Hi,

    I am currently running some robustness checks for my existing Logit model. I want to find the predicted probabilities that lie outside the 0-1 interval for the Linear Probability Model, which would help justify (or might not justify) the use of a Logit over an LPM.

    Does anyone know how to calculate the predicted probabilities that lie outside the 0-1 range?

    The code below is for the LPM model:
    reg poverty union i.SEX i.GORWKR i.HIQUL22D i.AGEEUL i.ETHUKEUL i.MARSTA i.MPNR02 i.INDC07M i.SC20MMJ i.FTPT i.JOBTYP, r

    Many thanks,
    Dillan

  • #2
    Code:
    predict phat
    gen byte out_of_range = !inrange(phat, 0, 1)

    Comment


    • #3
      Thanks, Clyde, that solidified my choice for a Logit as 29% of observations lay outside the 0-1 interval.

      However, when I ran the command for my Logit, I was expecting there to be 0 observations outside the 0-1 interval due to the nature of the regression, but the mean came back at 13%. Do you know why this is?

      Best regards,
      Dillan

      Comment


      • #4
        my guess is missing values and Clyde Schechter 's code should be revised to catch this by adding something like "& phat<."

        Comment


        • #5
          Ah yes, I have just seen STATA generated missing values. Thank you!

          Comment


          • #6
            Yes, Rich Goldstein is right that I should have added -if !missing(phat)- to the command in #2.

            And, indeed, there should not be any predicted probabilities outside the [0, 1] interval with -logit-. Missing values are one source. But there's another thing to look into. In the current version of Stata, -predict- after -logit- predicts the outcome probability. But it may be that in some earlier version(s) of Stata, -predict-, by default-, calculated xb, the linear combination. xb, of course, can range from negative inifnity to positive infinity. So just to be sure, re-run your -predict- command as -predict phat, pr-.

            Comment

            Working...
            X