Announcement

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

  • -cmp- calculate margins of an IV ordered probit model

    Hi,

    I am estimating an IV ordered probit model using the cmp command. Afterwards, I am trying to calculate the marginal effects of my main regressors but I always get an error message.
    The code looks like this:
    cmp (PlannedDurables = inflexp income_exp~d i.expmacroqu~g $controls) (inflexp = devinfpoint income_exp~d i.expmacroqu~g $controls), ind($cmp_oprobit $cmp_cont) qui
    margins, dydx(inflexp) predict(equation(PlannedDurables) pr) force


    The error message is:
    __marg_pvar_1 ambiguous abbreviation

    Does anyone have an idea what causes the error message?
    Thanks for the help.

  • #2
    I have managed to reproduce the problem and am working on it...
    Last edited by David Roodman; 23 May 2023, 06:39.

    Comment


    • #3
      The margins command calls the predict command. predict in turn calls cmp_p.ado, which defines the behavior of predict for cmp. By default, when you run predict for an ordered-probit equation, cmp_p generates a set of variables, such as the probabilities for each possible outcome. This is confusing margins. To fix it, run the margins command for one possible outcome at a time. For example:

      Code:
      margins, dydx(inflexp) predict(equation(PlannedDurables) outcome(#1) pr) force
      margins, dydx(inflexp) predict(equation(PlannedDurables) outcome(#2) pr) force
      margins, dydx(inflexp) predict(equation(PlannedDurables) outcome(#3) pr) force
      I'm optimistic this will work. For more on the outcome() option after ordered probit, see the very end of the cmp help file. In the outcome option, including a "#" lets you refer to the possible outcomes in order starting from 1. Leaving out the "#" lets you refer to their actual values. So if the actual possible values are -3, -2, -1 then outcome(#1) and outcome(-3) mean the same thing.
      Last edited by David Roodman; 23 May 2023, 06:51.

      Comment


      • #4
        Thank you, David. It works now.

        Comment


        • #5
          Hello, I am trying to calculate the marginal effects of the multivariate probit model (04 dependent binary variables) that I have developed using cmp
          The code is mentioned below.

          cmp (Y1 = X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X27) (Y2 = Y1# X15 X2 X4 X16 X17 X10 X18 X19 X14 X20) (Y3 = X15 X2 X3 X4 X21 X22 X8 X6 X7 X9 X23 X10 X12 X20) (Y4 =Y1# Y3# X2 X4 X8 X7 X24 X25 X10X11 X26 X28 X29 X30 X31 ),indicators($cmp_probit $cmp_probit $cmp_probit $cmp_probit) nolr redraws(200, anti) tech(dfp)


          code margins, dydx(*) predict(pr) provide marginal effects with respect to Y1

          But I could not calculate marginal effects with respect to Y2 with the code margins,dydx(*) predict(eq( Y2 ) pr) force

          There, the Output for the dy/dx says " 0 (omitted)"

          Is there anyone who could help me with the code, please?

          Thanks for the help.
          Last edited by Palee Hewage; 05 Jun 2023, 19:53.

          Comment

          Working...
          X