Announcement

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

  • reporting marginal effect of all outcomes at once after mprobit

    If I run the following code then it generates marginal effect for 2nd outcome.

    Code:
    webuse sysdsn3
    mprobit insure age male nonwhite site2 site3
    margins, dydx(nonwhite) predict(outcome(2))
    But how can I make it report marginal effect of nonwhite on every outcome in one shot? I tried

    Code:
    margins, dydx(nonwhite) predict(outcome(1) outcome(2) outcome(3))
    but it didn't work.

  • #2
    In version 15 you can just write
    Code:
    margins, dydx(nonwhite)
    and, by default, you will get the predicted probabilities for all outcome levels.

    I do not remember at what version this was introduced. In earlier versions, you had to write a loop like
    Code:
    forvalues i = 1/3 {
        margins, dydx(nonwhite) predict(outcome(`i'))
    }

    Comment


    • #3
      Clyde Schechter

      Thank you!!

      Comment


      • #4
        Edmondo: Clyde's approach is certainly the most efficient. I would just add that while the syntax you suggested doesn't work the following syntax does work (at least in v.15):
        Code:
        margins, dydx(nonwhite) predict(outcome(1)) predict(outcome(2)) predict(outcome(3))

        Comment

        Working...
        X