margins
Stata和Stata之间到底有什么区别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
------------------------------------------------------------------------------