Announcement

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

  • margins - option pmarg1 not allowed

    Dear all,

    Following suggestions to my previous question, I was able to submit a user-defined maximum likelihood program "mybiprob" and estimated a bivariate probit model as follows.

    ml model lf mybiprob ($y1list = $x1list) ($y2list = $zlist) /athrho, robust cluster(id)
    ml maximize

    Then, to obtain marginal effects, I issued the following command, but received an error saying the option pmarg1 is not allowed.
    . margins, dydx(*) atmeans predict(pmarg1)
    option pmarg1 not allowed

    Sorry for my ignorance but I am not sure where the problem lies and how to proceed. I would be grateful if someone could point out the right direction.

    Many thanks!
    Hitomi

  • #2
    I can't see your program, but I am guessing it is just using the default predict command, and that command does not know what pmarg1 means. In your program, I am guessing you need to add something like

    Code:
    ereturn local predict "mybiprob_p"
    You will have to write that program yourself. Unless maybe you can use the predict command for biprobit, in which case you can use

    Code:
    ereturn local predict "bipr_p"
    As an alternative, rather than modify your program, you could download -estadd- from SSC and, after running the ml commands, have a command like

    Code:
    estadd local predict bipr_p
    Programming your own predict command can be non-trivial. So, hopefully you can use an existing command, or find an easy way to modify an old one.

    One other possibility: margins does have an -expression- option. See the help. Perhaps you can code the equivalent of pmarg1 using it.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 18.5 MP (2 processor)

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

    Comment

    Working...
    X