我正在 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
命令返回保存的后估计结果。
如何存储边际效应值,然后将它们放入表格中以显示比较?
最佳答案
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
关于stata - 你如何在 Stata 中使用 margins 命令存储边际效应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28043371/