Announcement

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

  • Negative margins value with penalized maximumlikelihood estimates

    Hello, I've tried the logit with a binary variable but I found out that the sample size is only 95.
    I found out that Firth's Penalized Maximumlikehood methods can reduce small sample bias so that I tried it,
    and AIC improved better than logit model,
    but when I ran the margins, it shows negative value.


    logit experience money if married==1
    margins, at (money=4)


    firthlogit experience money if married==1
    margins, at (money=4)

    only difference was firthlogit and then I got a negative margins value(it didn't happen at logit).
    Why is that? and how can I solve the problem?

    Thanks a lot!

  • #2
    Welcome to the Stata Forum / Statalist.

    Please read the FAQ, particularly the topic about sharing command/output/data.

    That said, I gather this thread may be helpful to you.
    Best regards,

    Marcos

    Comment


    • #3
      Firthlogit is user written so it doesn't necessarily conform to all of the features of Stata. You're predicting a probability with logit. I suspect you're predicting something else with firstlogit, but I could be wrong.

      Comment


      • #4
        firthlogit does not have its own predict command, so the default is for xb, the log odds. You need something like

        Code:
        webuse nhanes2f, clear
        firthlogit diabetes i.female
        margins female, expression(invlogit(predict(xb)))
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Incidentally, margins tells you what is being predicted. If you don't change the defaults, after logit it says things like

          Code:
          Expression   : Pr(diabetes), predict()
          After firthlogit,

          Code:
          Expression   : Linear prediction, predict()
          People have gotten confused many times because the default prediction was not what they expected. Check the output if something seems odd.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          Stata Version: 17.0 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment

          Working...
          X