楼主: 海之鼠
56095 29

[回归分析求助] 使用reghdfe控制固定效应的问题 [推广有奖]

21
Val-GA 学生认证  发表于 2019-10-16 21:18:10
黃河泉 发表于 2019-3-14 08:29
請重新更新:
老师您好,我用了您发的安装命令但是还是报错是为什么呢?

reghdfe y c.D#c.post x1 x2 , absorb(id time) vce(robust)
file not found: ftools,.ado

net install ftools, from("https://raw.githubusercontent.com/sergiocorreia/ftools/master/src/")
checking ftools consistency and verifying not already installed...

the following files already exist and are different:
    D:\stata15\ado\plus\f\fcollapse.ado
    D:\stata15\ado\plus\f\fcollapse.sthlp
    D:\stata15\ado\plus\f\fsort.ado
    D:\stata15\ado\plus\f\fsort.sthlp
    D:\stata15\ado\plus\f\fisid.ado
    D:\stata15\ado\plus\f\fegen.ado
    D:\stata15\ado\plus\f\fegen.sthlp
    D:\stata15\ado\plus\f\fegen_group.ado
    D:\stata15\ado\plus\j\join.ado
    D:\stata15\ado\plus\j\join.sthlp
    D:\stata15\ado\plus\f\fmerge.ado
    D:\stata15\ado\plus\f\fcollapse_main.mata
    D:\stata15\ado\plus\f\fcollapse_functions.mata
    D:\stata15\ado\plus\m\ms_compile_mata.ado
    D:\stata15\ado\plus\m\ms_get_version.ado
    D:\stata15\ado\plus\m\ms_parse_absvars.ado
    D:\stata15\ado\plus\m\ms_parse_varlist.ado
    D:\stata15\ado\plus\m\ms_fvstrip.ado
    D:\stata15\ado\plus\f\ftab.ado

22
黃河泉 在职认证  发表于 2019-10-17 07:11:44
Val-GA 发表于 2019-10-16 21:16
老师您好,我用了您发的安装命令但是还是报错是为什么呢?

reghdfe y c.D#c.post x1 x2 , absorb(id ti ...
请根据 http://scorreia.com/software/reghdfe/install.html,更新你的 reghdfe & ftools。

23
XXH212380 学生认证  发表于 2020-4-22 22:12:03
明暄 发表于 2019-3-12 15:37
command ms_add_comma is unrecognized
是什么情况啊
我也出现这个问题了,请问您解决了吗?

24
Ganyuu123 发表于 2020-10-11 10:39:50
黃河泉 发表于 2018-1-11 18:27
的确,我依稀记得似乎 reghdfe 中作者有做了一些较不一样的处理 http://scorreia.com/software/reghdfe/,不 ...
老师你好,请问为什么reghdfe命令回归的结果显示的3个R平方,组内R2只有零点零几的情况下,上面两个R平方却比较大呢,应该以哪一个为参考呢

25
黃河泉 在职认证  发表于 2020-10-11 16:09:04
Ganyuu123 发表于 2020-10-11 10:39
老师你好,请问为什么reghdfe命令回归的结果显示的3个R平方,组内R2只有零点零几的情况下,上面两个R平方 ...
一般我会看: Adj R-squared。

26
Ganyuu123 发表于 2020-11-1 13:38:36
黃河泉 发表于 2020-10-11 16:09
一般我会看: Adj R-squared。
好的,谢谢

27
不可以游息5 学生认证  发表于 2021-7-15 22:21:27
黃河泉 发表于 2018-1-11 18:27
的确,我依稀记得似乎 reghdfe 中作者有做了一些较不一样的处理 http://scorreia.com/software/reghdfe/,不 ...
请教黄老师一个问题,我用reghdfe y x ,absorb(var) 与reg y x i.var 估计出来的系数是相同的,但是下一步想生成y的拟合值,predict yhat ,x,两种估计方法的拟合值是不一样的,请问有何区别?该选取哪种呢?谢谢!

28
zdlspace 学生认证  发表于 2021-7-16 13:01:02
不可以游息5 发表于 2021-7-15 22:21
请教黄老师一个问题,我用reghdfe y x ,absorb(var) 与reg y x i.var 估计出来的系数是相同的,但是下一步 ...

  1. /*reghde后若使用predict y,xb。 则生成的是不包括absorbvars的拟合值,
  2. 如果想要生成包括absorbvars的拟合值,则应使用predict y,xbd
  3. 但使用此命令前,需要在reghdfe命令后加residual选项,生成残差项。
  4. reg后使用predict y,xb 则生成的是包含虚拟变量的拟合值,所以如果希望得到一致的结果,
  5. reghdfe后需要做predict y,xbd ,而不是predict y,xb。*/

  6. *举例如下:

  7. sysuse auto,clear

  8. reghdfe price weight length, absorb(rep78)
  9. predict y1

  10. reg price weight length i.rep78
  11. predict y2

  12. reghdfe price weight length, absorb(rep78) res(r)
  13. predict y3,xbd

  14. list y1 y2 y3 in 1/10,noobs

  15.   +-----------------------------------+
  16.   |        y1          y2          y3 |
  17.   |-----------------------------------|
  18.   | 5837.8512   5283.7894   5283.7894 |
  19.   | 9562.3257   9008.2639   9008.2639 |
  20.   | 6220.2588           .           . |
  21.   |  6495.845   5941.7832   5941.7832 |
  22.   | 8195.6722   8630.2619   8630.2619 |
  23.   |-----------------------------------|
  24.   | 6387.5915   5833.5297   5833.5297 |
  25.   | 3755.1391           .           . |
  26.   | 6222.1682   5668.1064   5668.1064 |
  27.   |  8742.608   8188.5462   8188.5462 |
  28.   | 6879.5653   6325.5035   6325.5035 |
  29.   +-----------------------------------+

  30.   *可以看出,y2和y3的拟合值是一致的。建议使用y2或y3.
复制代码

29
bjergsen007 发表于 2022-2-17 13:33:31
Val-GA 发表于 2019-10-16 21:18
老师您好,我用了您发的安装命令但是还是报错是为什么呢?

reghdfe y c.D#c.post x1 x2 , absorb(id ...
我也出现这个问题了,请问您是怎么解决的?

30
WWENGEL 发表于 2023-2-1 10:44:47
请问reghdfe后应该如何做样本外预测呢?
试了predict y if e(sample)!=1,xbd
但得到的是一堆缺失值

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

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