【问题标题】:How do you store marginal effects using margins command in Stata?您如何在 Stata 中使用边距命令存储边际效应?
【发布时间】:2018-08-02 08:07:48
【问题描述】:

我在 Stata 中估计一个常规的probit 模型,并使用margins 命令来计算边际效应。

我试图说明在我的估计中将虚拟变量视为连续变量而不是将它们视为从 0 到 1 的离散变化时的效果变化。

probit dead dmage dmeduc i.dmar i.foreignb i.mblack i.mhispan i.motherr agesq i.tobacco i.alcohol
margins, dydx(alcohol tobacco) // treating the discrete variables 
margins, dydx(alcohol tobacco) continuous

根据文档,margins 命令使用e() 存储估计值。但是,当我在使用 margins 命令后尝试保存估计值时,无论我是否使用

return list 
ereturn list

它只是从我的probit 模型返回保存的后估计结果,而不是从margins 命令返回。

如何存储边际效应值,然后将它们放在表格中以显示比较?

【问题讨论】:

  • 我认为 Stata 没有这样做的技术工具,尽管您可以查看 Roger Newson 的结果集。

标签: stata effects


【解决方案1】:

margins 的文档说,如果您指定 post 选项,结果将在 e() 中返回。因此,这是一个可以满足您要求的示例:

sysuse auto, clear
gen byte good = rep78 > 3 if !missing(rep78)

probit good i.foreign price
margin , dydx(foreign) post
est store indicator

probit good foreign price
margins , dydx(foreign) post
est store continuous

est table indicator continuous, se

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-04
    • 1970-01-01
    • 2020-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多