Hello,
I am running a multinomial regression (mlogit), and I can't find a way to use the margins, dydx command to calculate the average marginal effect of a predictor on the probability of one outcome against each of the others, rather than the probability of one outcome against all the others (which is the default).
Here is an example
Ideally, I would like the average marginal effect for each of the three pairwise comparisons (if we may call it like that), i.e. the average marginal effect of age on the probability of outcome == 2 rather than == 1, then 1 against 3, and 2 against 3, just like the odds ratios table (if one runs the mlogit command twice and changes the base outcome), or the very margins,dydx command for binomial logistic regression.
Finally, I would also like to plot this, using marginsplot or any other useful command.
Many thanks!
Giuseppe
I am running a multinomial regression (mlogit), and I can't find a way to use the margins, dydx command to calculate the average marginal effect of a predictor on the probability of one outcome against each of the others, rather than the probability of one outcome against all the others (which is the default).
Here is an example
Code:
webuse margex logistic outcome age, or /* The odds ratio refers to the probability of outcome == 1 rather than == 0 */ margins , dydx(age) /* This is the average marginal effect of age on the probability of outcome == 1 rather than == 0 */ mlogit group age, rrr /* The odds ratio in the second row refers to the probability of outcome == 2 rather than == 1, while the one in the third row refers to the probability of outcome == 3 rather than == 1 */ margins , dydx(age) /* These are the average marginal effects of age on: (1) the probability of outcome == 1 rather than the other two, (2) the probability of outcome == 2 rather than the other two, (3) the probability of outcome == 3 rather than the other two */
Ideally, I would like the average marginal effect for each of the three pairwise comparisons (if we may call it like that), i.e. the average marginal effect of age on the probability of outcome == 2 rather than == 1, then 1 against 3, and 2 against 3, just like the odds ratios table (if one runs the mlogit command twice and changes the base outcome), or the very margins,dydx command for binomial logistic regression.
Finally, I would also like to plot this, using marginsplot or any other useful command.
Many thanks!
Giuseppe
Comment