I tried to calculate the marginal effect of firthlogit. I use "margins , expression(invlogit(predict(xb)))" following advice from #4 of this thread
HTML Code:
https://www.statalist.org/forums/forum/general-stata-discussion/general/1478121-negative-margins-value-with-penalized-maximumlikelihood-estimates
Among the independent variables, soe fie tradecom are binary, others are continuous. But when I tried to calculate the marginal effect. An error occurred and said: factor variables may not contain noninteger values. However, limpint is continous.
Does it mean that this way of calculation only suits factor variables? How can I calculate the marginal effect for all variables?
Below is the code and error. Any comments would be appreciated.
Many thanks,
K
Code:
firthlogit odistarter limpint soe fie tradecom process_share lexpint initial: penalized log likelihood = -49394.935 rescale: penalized log likelihood = -49394.935 Iteration 0: penalized log likelihood = -49394.935 Iteration 1: penalized log likelihood = -47937.173 Iteration 2: penalized log likelihood = -47677.303 Iteration 3: penalized log likelihood = -47676.333 Iteration 4: penalized log likelihood = -47676.333 Number of obs = 2,188,615 Wald chi2(6) = 3255.91 Penalized log likelihood = -47676.333 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ odistarter | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- limpint | 5.879801 .1970857 29.83 0.000 5.49352 6.266082 soe | .1002127 .0401549 2.50 0.013 .0215107 .1789148 fie | -1.241626 .0339263 -36.60 0.000 -1.308121 -1.175132 tradecom | -.560522 .0309983 -18.08 0.000 -.6212775 -.4997664 process_sh~e | -.2379967 .0389793 -6.11 0.000 -.3143946 -.1615987 lexpint | 6.334411 .2019787 31.36 0.000 5.93854 6.730282 _cons | -6.197648 .027174 -228.07 0.000 -6.250908 -6.144388 ------------------------------------------------------------------------------ . margins limpint soe fie tradecom process_share lexpint, expression(invlogit( > predict(xb))) limpint: factor variables may not contain noninteger values r(452);
0 Response to marginal effect of firthlogit
Post a Comment