楼主: liushuaiguang
25671 5

[回归分析求助] Probit模型计算的平均边际效应怎么输出 [推广有奖]

  • 3关注
  • 8粉丝

已卖:136份资源

副教授

22%

还不是VIP/贵宾

-

威望
0
论坛币
1128 个
通用积分
40.9210
学术水平
51 点
热心指数
48 点
信用等级
35 点
经验
7870 点
帖子
294
精华
0
在线时间
1065 小时
注册时间
2009-8-31
最后登录
2023-12-30

楼主
liushuaiguang 发表于 2016-9-6 16:01:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我用stata做probit模型,probit计算的回归系数一般需要再用margins,dydx(*)来计算平均边际效应,但是计算平均边际效应后使用esttab命令输出结果,输出的数据还是probit的回归系数,而不是平均边际效应和相应的标准差,这个问题怎么解决。我回归时的命令如下:probit y x1 x2 x3
margins,dydx(*)
est store est1
esttab est1 using abc.rtf,r2 ar2 pr2 se(4) b(4) star(* 0.1 ** 0.05 *** 0.01)    replace

这个命令应该怎么修改才能输出平均边际效应系数
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Probit 边际效应 bit Rob Margins 模型

回帖推荐

蓝色 发表于2楼  查看完整内容

用outreg2 不要用esttab 模仿oureg2里面的例子

本帖被以下文库推荐

沙发
蓝色 发表于 2016-9-6 16:18:20
用outreg2
不要用esttab
模仿oureg2里面的例子

  1. *Example 11. Marginal Effects

  2.    * mfx option can be used to report marginal effects after mfx command has been applied.
  3.     sysuse auto, clear
  4.     logit foreign mpg rep78 head
  5.     mfx compute
  6.     outreg2 using myfile, replace
  7.     outreg2 using myfile, mfx ctitle(mfx) see

  8.     *margins will report it as well.
  9.     sysuse auto, clear
  10.     logit foreign mpg rep78 head
  11.     margins, dydx(_all) post
  12.     outreg2 using myfile, ctitle(margins) see

  13.     *For multiple outcomes, you may want to use mfx2 by Ricahrd Williams or margeff by Tamas
  14.     *Bartus. They are both available from ssc.

  15.     *margeff example:
  16.     sysuse auto, clear
  17.     mlogit rep turn mpg price
  18.     margeff, at(mean) replace
  19.     outreg2 using myfile, cttop(margeff) see replace

  20.     *mfx2 runs a little slower:
  21.     sysuse auto, clear
  22.     mlogit rep turn mpg price
  23.     mfx2, replace
  24.     outreg2 using myfile, long cttop(mfx2) see replace

  25.     *The marginal effects reported by dprobit, dlogit2, dprobit2, and dmlogit2 are
  26.     *automatically reported by outreg2.

  27.    * Because truncreg, marginal, and dtobit report both regression coefficients and marginal
  28.     *effects, the user must specify the margin option for outreg2 report the marginal
  29.     *effects.

  30.     *dtobit, on the other hand, calculates three different marginal effects.  The user must
  31.     *specify which marginal effect, the unconditional, conditional, or the probability
  32.     *uncensored, to be reported. Note that "version 6" must be set for dtobit to work.

  33.     version 6: tobit mpg trunk weight, ll(17)
  34.     version 6: dtobit
  35.     outreg2 using myfile, margin(u) ctitle(Unconditional) nor2 replace
  36.     outreg2 using myfile, margin(c) ctitle(Conditional) nor2
  37.     outreg2 using myfile, margin(p) ctitle(Probability) nor2 see
复制代码


已有 1 人评分经验 学术水平 热心指数 收起 理由
Captain-CUI + 20 + 1 + 1 精彩帖子

总评分: 经验 + 20  学术水平 + 1  热心指数 + 1   查看全部评分

藤椅
liushuaiguang 发表于 2016-9-7 12:06:24
蓝色 发表于 2016-9-6 16:18
用outreg2
不要用esttab
模仿oureg2里面的例子
谢谢!刚才试了一下,确实可以导出margins结果。但有另外一个问题,我试了一下,好像一次只能导出一个结果,例如我想要导出两个回归的margins结果,写命令如下:

logit foreign mpg rep78 head
margins, dydx(_all) post
est store est1
logit foreign mpg rep78 head gear_ratio
margins, dydx(_all) post
est store est2
outreg2 est1 est2 using myfile.rtf, ctitle(margins)

但是只出了est2的结果,没出est1的结果,这是为什么啊?

板凳
蓝色 发表于 2016-9-7 14:00:20
  1. sysuse auto,clear
  2. logit foreign mpg rep78 head
  3. margins, dydx(_all) post
  4. est store est1
  5. outreg2  using d:\myfile.rtf, ctitle(margins) replace

  6. logit foreign mpg rep78 head gear_ratio
  7. margins, dydx(_all) post
  8. est store est2
  9. outreg2  using d:\myfile.rtf, ctitle(margins)
复制代码
那就每产生一个就输出一个

报纸
米高兄弟 在职认证  发表于 2022-3-14 15:10:16
很棒啊!太经典了

地板
赵安豆 发表于 2024-5-20 00:17:24
在stata中,要将`margins`计算的平均边际效应和标准差添加到`esttab`输出,你需要使用`estadd`命令。以下是修改后的代码:

```
probit y x1 x2 x3
margins, dydx(*) atmeans
est store est1
estadd margins, dydx(*) atmeans
esttab est1 using abc.rtf, r2 ar2 pr2 se(4) b(4) star(* 0.1 ** 0.05 *** 0.01) replace
```

这段代码首先计算了所有变量的平均边际效应,然后使用`estadd`将这些值添加到存储的结果中。最后,`esttab`会输出包含平均边际效应和标准差的表格。注意,`atmeans`选项表示在因变量和自变量均值处计算边际效应。如果你需要在其他特定点计算,可以调整该选项。

此文本由CAIE学术大模型生成,添加下方二维码,优先体验功能试用



您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-14 09:12