我正在使用gsem来拟合选择模型,就像在Stata 14中的示例45g那样。然后我需要计算选择方程的边际效应,但我得到了越界预测,即,边际效应是负面的。以下是45g示例的修订版本:
gsem (wage <- i.married age L) (selected <- i.married age i.married#c.age L@1, family(gaussian, udepvar(notselected))), var(L@1 e.wage@a e.selected@a)
(output omitted)
margins, predict(outcome(selected) fixed) over(married) at(age=(20(1)30))
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_at#married |
1 0 | -.3827148 .2121198 -1.80 0.071 -.7984619 .0330323
1 1 | -.390719 .226889 -1.72 0.085 -.8354132 .0539752
2 0 | -.327103 .1943685 -1.68 0.092 -.7080582 .0538523
2 1 | -.2970482 .2048702 -1.45 0.147 -.6985864 .1044899
3 0 | -.2714911 .1774268 -1.53 0.126 -.6192413 .0762591
3 1 | -.2033775 .1851481 -1.10 0.272 -.566261 .1595061
4 0 | -.2158792 .1615497 -1.34 0.181 -.5325108 .1007523
4 1 | -.1097067 .168531 -0.65 0.515 -.4400214 .2206079
5 0 | -.1602674 .1470822 -1.09 0.276 -.4485432 .1280084
5 1 | -.0160359 .1560142 -0.10 0.918 -.3218181 .2897463
6 0 | -.1046555 .1344801 -0.78 0.436 -.3682316 .1589206
6 1 | .0776348 .1486372 0.52 0.601 -.2136888 .3689584
7 0 | -.0490437 .124312 -0.39 0.693 -.2926907 .1946033
7 1 | .1713056 .147175 1.16 0.244 -.117152 .4597632
8 0 | .0065682 .1172129 0.06 0.955 -.223165 .2363014
8 1 | .2649764 .1517985 1.75 0.081 -.0325432 .5624959
9 0 | .0621801 .1137592 0.55 0.585 -.1607839 .2851441
9 1 | .3586471 .1619874 2.21 0.027 .0411576 .6761367
10 0 | .1177919 .1142816 1.03 0.303 -.1061959 .3417798
10 1 | .4523179 .1767822 2.56 0.011 .1058312 .7988046
11 0 | .1734038 .1187277 1.46 0.144 -.0592982 .4061058
11 1 | .5459887 .1951379 2.80 0.005 .1635254 .928452
------------------------------------------------------------------------------
marginsplot
在这个例子中,20到30岁之间选择工作的已婚和未婚女性(即有效工资数据)的概率应该只有0到1,但在计算边际效应时,其中一些变为负面
我的预感是,本例中选择方程的结果被指定为高斯同一性分布,允许预测从[0,1]中脱落。有人可以建议如何修改代码以获得[0,1]范围内的边际效应吗?
非常感谢。