楼主: miasebwuluwulu
2462 10

[回归分析求助] noconstant absorb(x y) resid为什么会有invalid options报错 [推广有奖]

  • 0关注
  • 0粉丝

学前班

70%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
40 点
帖子
1
精华
0
在线时间
3 小时
注册时间
2022-3-6
最后登录
2023-1-24

楼主
miasebwuluwulu 发表于 2022-3-6 21:36:24 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
reghdfe xx xx xx xx, noconstant absorb(year firm) resid
上面这行代码运行的时候有“invalid options: noconstant resid”报错,该怎么改啊,哭了,急
二维码

扫码加我 拉你入群

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

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

关键词:noconstant constant invalid options nocons Stata Stata专版 stata面板中 stata数据处理

沙发
pan1129 发表于 2022-3-24 16:14:40
我也遇到了这个问题,请问楼主解决了吗?

藤椅
黃河泉 在职认证  发表于 2022-3-24 16:55:10
我刚试试,没问题:
  1. sysuse auto, clear
  2. reghdfe price weight length, noconstant absorb(rep78) resid
复制代码
其结果
  1. . reghdfe price weight length, noconstant absorb(rep78) resid
  2. (MWFE estimator converged in 1 iterations)

  3. HDFE Linear regression                            Number of obs   =         69
  4. Absorbing 1 HDFE group                            F(   2,     62) =      22.98
  5.                                                   Prob > F        =     0.0000
  6.                                                   R-squared       =     0.4341
  7.                                                   Adj R-squared   =     0.3793
  8.                                                   Within R-sq.    =     0.4258
  9.                                                   Root MSE        =  2294.5106

  10. ------------------------------------------------------------------------------
  11.        price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
  12. -------------+----------------------------------------------------------------
  13.       weight |   5.478309   1.158582     4.73   0.000     3.162337    7.794281
  14.       length |  -109.5065   39.26104    -2.79   0.007    -187.9882   -31.02482
  15. ------------------------------------------------------------------------------

  16. Absorbed degrees of freedom:
  17. -----------------------------------------------------+
  18. Absorbed FE | Categories  - Redundant  = Num. Coefs |
  19. -------------+---------------------------------------|
  20.        rep78 |         5           0           5     |
  21. -----------------------------------------------------+
复制代码
请更新你的 reghdfe。

板凳
黃河泉 在职认证  发表于 2022-3-24 16:55:56
  1. * Install ftools (remove program if it existed previously)
  2. cap ado uninstall ftools
  3. net install ftools, from("https://raw.githubusercontent.com/sergiocorreia/ftools/master/src/")

  4. * Install reghdfe 6.x
  5. cap ado uninstall reghdfe
  6. net install reghdfe, from("https://raw.githubusercontent.com/sergiocorreia/reghdfe/master/src/")

  7. * Install parallel, if using the parallel() option; don't install from SSC
  8. cap ado uninstall parallel
  9. net install parallel, from([url]https://raw.github.com/gvegayon/parallel/stable/)[/url] replace
  10. mata mata mlib index
复制代码

报纸
xhdxlhs 发表于 2023-3-13 15:29:50
黃河泉 发表于 2022-3-24 16:55
我刚试试,没问题:其结果请更新你的 reghdfe。
麻烦问一下,怎么更新reghdfe呢?拜托拜托拜托

地板
黃河泉 在职认证  发表于 2023-3-14 08:08:32
xhdxlhs 发表于 2023-3-13 15:29
麻烦问一下,怎么更新reghdfe呢?拜托拜托拜托
好像这一阵子,原作者提供的更新指令都无法运行。

7
iceovo 学生认证  发表于 2023-8-15 14:14:10
黃河泉 发表于 2023-3-14 08:08
好像这一阵子,原作者提供的更新指令都无法运行。
现在也还没有办法用吗?我今天试还是显示invalid options: cons

8
蓝色 发表于 2023-8-15 14:34:54
ssc install reghdfe,replace
ssc install ftools,replace

今天刚安装量命令,没有问题

9
蓝色 发表于 2023-8-15 14:35:42
iceovo 发表于 2023-8-15 14:14
现在也还没有办法用吗?我今天试还是显示invalid options: cons
  1. . sysuse auto, clear
  2. (1978 automobile data)

  3. . reghdfe price weight length, noconstant absorb(rep78) resid
  4. (MWFE estimator converged in 1 iterations)

  5. HDFE Linear regression                            Number of obs   =         69
  6. Absorbing 1 HDFE group                            F(   2,     62) =      22.98
  7.                                                   Prob > F        =     0.0000
  8.                                                   R-squared       =     0.4341
  9.                                                   Adj R-squared   =     0.3793
  10.                                                   Within R-sq.    =     0.4258
  11.                                                   Root MSE        =  2294.5106

  12. ------------------------------------------------------------------------------
  13.        price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
  14. -------------+----------------------------------------------------------------
  15.       weight |   5.478309   1.158582     4.73   0.000     3.162337    7.794281
  16.       length |  -109.5065   39.26104    -2.79   0.007    -187.9882   -31.02482
  17. ------------------------------------------------------------------------------

  18. Absorbed degrees of freedom:
  19. -----------------------------------------------------+
  20. Absorbed FE | Categories  - Redundant  = Num. Coefs |
  21. -------------+---------------------------------------|
  22.        rep78 |         5           0           5     |
  23. -----------------------------------------------------+
复制代码

10
iceovo 学生认证  发表于 2023-8-15 15:24:11
蓝色 发表于 2023-8-15 14:35
我试你这个例子,我也可以通过,但是我跑自己的代码,它还是显示invalid options: noconstant

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

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