楼主: tryee
43951 47

[编程问题求助] 请教Reghdfe做工具变量回归问题 [推广有奖]

  • 0关注
  • 60粉丝

贵宾

睡熊PK小猪

已卖:1546份资源

院士

31%

还不是VIP/贵宾

-

威望
3
论坛币
3275938 个
通用积分
48.0144
学术水平
89 点
热心指数
101 点
信用等级
28 点
经验
122786 点
帖子
874
精华
3
在线时间
3635 小时
注册时间
2004-11-2
最后登录
2025-11-27

初级热心勋章

楼主
tryee 发表于 2018-10-12 11:47:31 |AI写论文
500论坛币

请教下大家,用Reghdfe做工具变量回归时候总是系统提示一下,不知道大家遇到过或如何解决的呢?
回归方程为
reghdfe a (b=c),absorb(year)
系统提示为
option sdofminus() not allowed

最佳答案

蓝色 查看完整内容

1、上面链接作者已经说了https://github.com/sergiocorreia/reghdfe/issues/146 My bad, the error message is not quite clear:I moved the IV code of reghdfe into ivreghdfe, so you need to install and use that package in order to do IV(technically, there is no "IV" code, as I was just wrapping ivreg2) 要用ivreghdfe命令,不要要用reghdfe命令了 2、把ivreg2、reghdfe、ivreghdfe和ftools命令重新安装一 ...
关键词:工具变量回归 回归方程 如何解决 变量回归 工具变量

沙发
蓝色 发表于 2018-10-12 11:47:32
1、上面链接作者已经说了https://github.com/sergiocorreia/reghdfe/issues/146

My bad, the error message is not quite clear:

I moved the IV code of reghdfe into ivreghdfe, so you need to install and use that package in order to do IV

(technically, there is no "IV" code, as I was just wrapping ivreg2)



ivreghdfe.png

要用ivreghdfe命令,不要要用reghdfe命令了

2、把ivreg2、reghdfe、ivreghdfe和ftools命令重新安装一下,然后在执行



已有 1 人评分学术水平 热心指数 信用等级 收起 理由
黃河泉 + 2 + 2 + 2 我很赞同

总评分: 学术水平 + 2  热心指数 + 2  信用等级 + 2   查看全部评分

藤椅
黃河泉 在职认证  发表于 2018-10-12 16:08:00
请 search ivreghdfe 并安装,看看 help ivreghdfe 之说明。

板凳
kobe_love_jolin 发表于 2018-10-12 16:56:47
黃河泉 发表于 2018-10-12 16:08
请 search ivreghdfe 并安装,看看 help ivreghdfe 之说明。
黄老师,您好!
我运行ivreghdfe帮助里的自带数据时显示last estimates not found,请问是何原因呢?


. sysuse auto
(1978 Automobile Data)

. ivreghdfe price weight (length=gear), absorb(rep78, tol(1e-6))
last estimates not found
r(301);

报纸
黃河泉 在职认证  发表于 2018-10-12 16:58:50
kobe_love_jolin 发表于 2018-10-12 16:56
黄老师,您好!
我运行ivreghdfe帮助里的自带数据时显示last estimates not found,请问是何原因呢?

...
我的没问题,
  1. . sysuse auto, clear
  2. (1978 Automobile Data)

  3. . ivreghdfe price weight (length=gear), absorb(rep78, tol(1e-6))
  4. (MWFE estimator converged in 1 iterations)

  5. IV (2SLS) estimation
  6. --------------------

  7. Estimates efficient for homoskedasticity only
  8. Statistics consistent for homoskedasticity only

  9.                                                       Number of obs =       69
  10.                                                       F(  2,    62) =    11.08
  11.                                                       Prob > F      =   0.0001
  12. Total (centered) SS     =  568436416.2                Centered R2   =   0.0008
  13. Total (uncentered) SS   =  568436416.2                Uncentered R2 =   0.0008
  14. Residual SS             =    567997123                Root MSE      =     3027

  15. ------------------------------------------------------------------------------
  16.        price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
  17. -------------+----------------------------------------------------------------
  18.       length |   156.4453   345.4758     0.45   0.652    -534.1511    847.0417
  19.       weight |  -1.899938   9.598611    -0.20   0.844    -21.08729    17.28741
  20. ------------------------------------------------------------------------------
  21. Underidentification test (Anderson canon. corr. LM statistic):           1.551
  22.                                                    Chi-sq(1) P-val =    0.2130
  23. ------------------------------------------------------------------------------
  24. Weak identification test (Cragg-Donald Wald F statistic):                1.425
  25. Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
  26.                                          15% maximal IV size              8.96
  27.                                          20% maximal IV size              6.66
  28.                                          25% maximal IV size              5.53
  29. Source: Stock-Yogo (2005).  Reproduced by permission.
  30. ------------------------------------------------------------------------------
  31. Sargan statistic (overidentification test of all instruments):           0.000
  32.                                                  (equation exactly identified)
  33. ------------------------------------------------------------------------------
  34. Instrumented:         length
  35. Included instruments: weight
  36. Excluded instruments: gear_ratio
  37. Partialled-out:       _cons
  38.                       nb: total SS, model F and R2s are after partialling-out;
  39.                           any small-sample adjustments include partialled-out
  40.                           variables in regressor count K
  41. ------------------------------------------------------------------------------

  42. Absorbed degrees of freedom:
  43. -----------------------------------------------------+
  44. Absorbed FE | Categories  - Redundant  = Num. Coefs |
  45. -------------+---------------------------------------|
  46.        rep78 |         5           0           5     |
  47. -----------------------------------------------------+
复制代码

地板
kobe_love_jolin 发表于 2018-10-12 17:02:21
黃河泉 发表于 2018-10-12 16:58
我的没问题,
真奇了怪了?!
难道是Mac与Windows的差异?
我用的是Mac版Stata 14.1

谢谢您的答复,祝好!!

7
黃河泉 在职认证  发表于 2018-10-12 17:05:30
kobe_love_jolin 发表于 2018-10-12 17:02
真奇了怪了?!
难道是Mac与Windows的差异?
我用的是Mac版Stata 14.1
1.. 我是用 Windows, Stata 15.1,有无差别我就无从得知了! 2. 请其他同学试试!

8
kobe_love_jolin 发表于 2018-10-12 17:13:36
黃河泉 发表于 2018-10-12 17:05
1.. 我是用 Windows, Stata 15.1,有无差别我就无从得知了! 2. 请其他同学试试!
好的,非常感谢您的答复!!

9
tryee 发表于 2018-10-12 21:09:18
运行程序ivreghdfe后系统提示
struct ms_vcvorthog undefined
(817 lines skipped)

10
蓝色 发表于 2018-10-12 21:29:59

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-20 19:17