Announcement

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

  • Margins after xtologit


    I am using Stata13 and run a panel ordered logit model using xtologit. As I am interested in the marginal effects at the different outcomes I afterwards tried margins, dydx(*) predict(outcome(1)) However, while this works after ologit it does not work after xtologit. (I can derive the average marginal effects using margins, dydx(*).) Is there another way to get the marginal effects at different outcomes? Thanks Tommy

  • #2
    Statalist discussions are generally easier to follow with an example we can
    all play with.

    I will use an example from the manual entry for xtologit.

    Code:
    webuse tvsfpors
    xtset school
    xtologit thk prethk cc##tv
    Before using margins, we can try to compute a prediction for the first
    outcome.

    Code:
    predict zz, outcome(1)
    (option xb assumed; linear prediction)
    option outcome() not allowed with xb
    Based on this, it appears that we must specify the pu0 option with the
    outcome() option.

    This explains why the following margins call is not working.

    Code:
    margins, dydx(*) predict(outcome(1))
    It is curious that we get r(198); without an error message though.

    The following work as expected.

    Code:
    margins, dydx(*) predict(pu0 outcome(1))
    margins, dydx(*) predict(pu0 outcome(2))
    margins, dydx(*) predict(pu0 outcome(3))
    margins, dydx(*) predict(pu0 outcome(4))

    Comment


    • #3
      yes it works with me now , thank you so much Jeff.

      Comment


      • #4
        Hello everybody, I know that this is a very old post, but I hope someone could help me. Your answer has helped me with my research, but I am struggling to plot the marginal effects of these comands in a single plot.

        margins, dydx(*) predict(pu0 outcome(1))
        margins, dydx(*) predict(pu0 outcome(2))
        margins, dydx(*) predict(pu0 outcome(3))
        margins, dydx(*) predict(pu0 outcome(4))

        Can you help me?

        Comment


        • #5
          Originally posted by Paride Carrara View Post
          Hello everybody, I know that this is a very old post, but I hope someone could help me. Your answer has helped me with my research, but I am struggling to plot the marginal effects of these comands in a single plot.

          margins, dydx(*) predict(pu0 outcome(1))
          margins, dydx(*) predict(pu0 outcome(2))
          margins, dydx(*) predict(pu0 outcome(3))
          margins, dydx(*) predict(pu0 outcome(4))

          Can you help me?
          Hello, have you already solved the problem? I am struglinng with the same one. Thank you.

          Comment

          Working...
          X