Dear Stata experts,
I am running a multinomial regression with mlogit command. I am trying to represent graphically marginal effects and z-statistics according to Wiersema and Bowen (2009) study. However, I have found some problems.
Imagine that I have a dependent variable, depvar (whose value can be 1, 2 or 3) and three independent variables: X, Z and W.
When I follow the commands suggested by Wiersema and Bowen (2009) to graph marginal effects of X on depvar (e.g.), I find these Stata outcomes:
mlogit depvart X Z W, baseoutcome(1) nolog cluster(id)
Multinomial logistic regression Number of obs = 2044
LR chi2(16) = 142.15
Prob > chi2 = 0.0000
Log likelihood = -728.19599 Pseudo R2 = 0.0889
---------------------------------------------------------------------------------
depvar | Coef. Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
1 | (base outcome)
----------------+----------------------------------------------------------------
2 |
X | -.2188117 .0730577 -3.00 0.003 -.3620021 -.0756212
Z | -.1347548 .107372 -1.26 0.209 -.3452001 .0756905
W | 1.264154 .3165777 3.99 0.000 .6436732 1.884635
_cons | -2.864977 .3343431 -8.57 0.000 -3.520277 -2.209676
----------------+----------------------------------------------------------------
3 |
X | -.0370888 .0854292 -0.43 0.664 -.2045269 .1303493
Z | -.1574901 .1573289 -1.00 0.317 -.4658492 .1508689
W | .8619795 .4664669 1.85 0.065 -.0522787 1.776238
_cons | -3.749001 .476946 -7.86 0.000 -4.683798 -2.814205
---------------------------------------------------------------------------------
. predict p1 p2 p3
(option pr assumed; predicted probabilities)
. local vb _b[_cons] + _b[X]*X + _b[Z]*Z + _b[W]*W
. local phat (exp(`vb')/(1+exp(`vb')))
. predictnl meX = `phat'*(1-`phat')*_b[X], se(meX_se)
Warning: prediction doesn't vary with respect to e(b).
Warning: prediction constant over observations; perhaps you meant to run nlcom.
. gen z_stat = meX/meX_se
(2044 missing values generated)
Missing values are generated because meX_se are 0 (from the predictnl command), but I do not understand why it happens.
Is there a problem with data? Or these kind of commands can only been used with logit regression (not with mlogit)? If that was the case, could anybody help me to build the marginal effects graphs to better interpret results in a multinomial regress?
I would appreciate any help.
Thank you in advance.
I am running a multinomial regression with mlogit command. I am trying to represent graphically marginal effects and z-statistics according to Wiersema and Bowen (2009) study. However, I have found some problems.
Imagine that I have a dependent variable, depvar (whose value can be 1, 2 or 3) and three independent variables: X, Z and W.
When I follow the commands suggested by Wiersema and Bowen (2009) to graph marginal effects of X on depvar (e.g.), I find these Stata outcomes:
mlogit depvart X Z W, baseoutcome(1) nolog cluster(id)
Multinomial logistic regression Number of obs = 2044
LR chi2(16) = 142.15
Prob > chi2 = 0.0000
Log likelihood = -728.19599 Pseudo R2 = 0.0889
---------------------------------------------------------------------------------
depvar | Coef. Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
1 | (base outcome)
----------------+----------------------------------------------------------------
2 |
X | -.2188117 .0730577 -3.00 0.003 -.3620021 -.0756212
Z | -.1347548 .107372 -1.26 0.209 -.3452001 .0756905
W | 1.264154 .3165777 3.99 0.000 .6436732 1.884635
_cons | -2.864977 .3343431 -8.57 0.000 -3.520277 -2.209676
----------------+----------------------------------------------------------------
3 |
X | -.0370888 .0854292 -0.43 0.664 -.2045269 .1303493
Z | -.1574901 .1573289 -1.00 0.317 -.4658492 .1508689
W | .8619795 .4664669 1.85 0.065 -.0522787 1.776238
_cons | -3.749001 .476946 -7.86 0.000 -4.683798 -2.814205
---------------------------------------------------------------------------------
. predict p1 p2 p3
(option pr assumed; predicted probabilities)
. local vb _b[_cons] + _b[X]*X + _b[Z]*Z + _b[W]*W
. local phat (exp(`vb')/(1+exp(`vb')))
. predictnl meX = `phat'*(1-`phat')*_b[X], se(meX_se)
Warning: prediction doesn't vary with respect to e(b).
Warning: prediction constant over observations; perhaps you meant to run nlcom.
. gen z_stat = meX/meX_se
(2044 missing values generated)
Missing values are generated because meX_se are 0 (from the predictnl command), but I do not understand why it happens.
Is there a problem with data? Or these kind of commands can only been used with logit regression (not with mlogit)? If that was the case, could anybody help me to build the marginal effects graphs to better interpret results in a multinomial regress?
I would appreciate any help.
Thank you in advance.
Comment