【问题标题】:Recording marginal effects in Stata instead of coefficients in a regression table在Stata中记录边际效应而不是回归表中的系数
【发布时间】:2014-08-18 05:43:33
【问题描述】:

我需要使用 estout 或 outreg 将以下模型的边际效应保存在表格中。我在下面使用的命令只保存表中的系数,而不是边际效应。我已经尝试了很多,但没有任何效果

sysuse auto

reg price mpg rep78 foreign, robust
margins, dydx(*)
estimates store m1, title(Model 1)

tobit price mpg rep78 foreign, 11(0)
margins, dydx(*) predict (ystar(0,.) )
estimates store m2, title(Model 2)

probit price mpg rep78 foreign
margins, dydx(*)
estimates store m3, title(Model 3)

truncreg price mpg rep78 foreign
margins, dydx(*) predict(e(0,.))
estimates store m4, title(Model 4)

estout m1 m2 m3 m4 , cells(b(star fmt(3)) se(par fmt(2)))

【问题讨论】:

标签: regression stata


【解决方案1】:

我举一个例子来说明你的要求。但是,请注意

在线性回归模型中,边际效应等于相关斜率系数(https://www3.nd.edu/~rwilliam/stats/Margins01.pdf

所以你可能会得到正确的结果。 (如果遇到与您的原始查询无关的错误,我将无法运行您的代码。)

示例包含线性和非线性模型以强调最后一点:

clear all
set more off

*----- example data -----

*from http://repec.org/bocode/e/estout/advanced.html
sysuse auto

generate reprec = (rep78 > 3) if rep78 < .

*----- what you want -----

eststo clear

regress foreign mpg reprec
margins, dydx(*) post
eststo modreg

logit foreign mpg reprec
margins, dydx(*) post
eststo modlog

esttab, se mtitles title(Marginal effects)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-13
    • 2020-03-05
    • 2014-12-16
    • 2019-11-16
    • 2019-07-15
    • 1970-01-01
    相关资源
    最近更新 更多