【发布时间】:2020-08-25 15:30:55
【问题描述】:
Stata 中的margins 和lincom 到底有什么区别?如何调整nlcom 中的手动公式以匹配margins 的结果?谢谢
* load data
use http://www.stata-press.com/data/r13/nlswork
* set panel structure
xtset idcode year
* fixed effects regression
xtreg ln_wage c.wks_ue##c.wks_ue union age, fe coeflegend
margins, dydx(wks_ue)
------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
wks_ue | -.00594 .0009744 -6.10 0.000 -.0078497 -.0040303
------------------------------------------------------------------------------
* check with lincom/nlcom
lincom _b[wks_ue] + 2*_b[c.wks_ue#c.wks_ue]
nlcom _b[wks_ue] + 2*_b[c.wks_ue#c.wks_ue]
------------------------------------------------------------------------------
ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_nl_1 | -.0062406 .0010319 -6.05 0.000 -.0082632 -.0042181
------------------------------------------------------------------------------
【问题讨论】:
-
确实,我对
lincom的一行很感兴趣,它使结果等同于margins。谢谢
标签: regression stata marginal-effects