Please consider the following contrived example (from the Manual [https://www.stata.com/manuals/rmargins.pdf#page=23]).
One can obtain margins for multiple outcomes simultaneously
And one can obtain margins for a specific expression involving one outcome
But if you fold multiple predict() options inside of the expression() option Stata seems to throw a code. This next line returns a r(111) error that reads "__marg_pvar_1__marg_pvar_2 not found"
How does one obtain margins of a specified expression with multiple outcomes? Is it possible to specify the expression() option so that you can obtain margins for multiple outcomes simultaneously?
Thank you for your time, consideration, and help.
Code:
use https://www.stata-press.com/data/r17/margex, clear mlogit group i.sex age
Code:
margins sex, predict(outcome(1)) predict(outcome(3))
Code:
margins sex, expression(invlogit(predict(outcome(1))))
Code:
margins sex, exp(invlogit(predict(outcome(1)) predict(outcome(3))))
Thank you for your time, consideration, and help.
Comment