全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
42391 31
2021-06-01
很多人用ivreghdfe回归却不会得出两步回归结果,本人经过探索,发现了其中的办法。大家可以试试看看。可以outreg2得出第一步和第二步结果。
附件列表

ivreghdfe.do

大小:657 Bytes

只需: 270 个论坛币  马上下载

ivreghdfe得出两步回归结果

二维码

扫码加我 拉你入群

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

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

全部回复
2022-5-19 19:18:49
1.没有案例数据可以执行,所以不知道是不是数据的问题还是命令下载不全的问题, 楼主给的命令不能很好执行
2.和ivregress2的案例命令非常像,差别在于①把控制变量放在(内生变量=iv)后面,②ivreghdfe命令前加了eststo: ,但是执行错误(option absorb() not allowed),不知道什么原因,③加了两个option:savefirst savefp(f),④这条命令之后的est restore f+解释变量  

要是能解释一下以上这几点变动的原因就好了。也不知道为什么出错。

二维码

扫码加我 拉你入群

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

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

2022-5-19 19:53:49
参考https://github.com/sergiocorreia/reghdfe/#citation安装好最新的命令,最新的reghdfe 6.x不能通过 SSC安装

To find out which version you have installed, type reghdfe, version.

reghdfe 6.x is not yet in SSC. To quickly install it and all its dependencies, copy/paste these lines and run them:

* Install ftools (remove program if it existed previously)
cap ado uninstall ftools
net install ftools, from("https://raw.githubusercontent.com/sergiocorreia/ftools/master/src/")

* Install reghdfe 6.x
cap ado uninstall reghdfe
net install reghdfe, from("https://raw.githubusercontent.com/sergiocorreia/reghdfe/master/src/")
To run IV/GMM regressions with ivreghdfe, also run these lines:

cap ado uninstall ivreg2hdfe
cap ado uninstall ivreghdfe
cap ssc install ivreg2 // Install ivreg2, the core package
net install ivreghdfe, from(https://raw.githubusercontent.co ... eghdfe/master/src/)
Alternatively, you can install the stable/older version from SSC (5.x):

cap ado uninstall reghdfe
ssc install reghdfe
二维码

扫码加我 拉你入群

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

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

2022-5-19 20:23:03
Lee_iris 发表于 2022-5-19 19:18
1.没有案例数据可以执行,所以不知道是不是数据的问题还是命令下载不全的问题, 楼主给的命令不能很好执行 ...
f+你的核心解释变量
二维码

扫码加我 拉你入群

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

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

2022-5-19 21:23:33
①把控制变量放在(内生变量=iv)后面和放前面貌似没有什么差异
②ivreghdfe命令前加了eststo: ,但是执行错误(option absorb() not allowed),可以通过先执行ivreghdfe再执行eststo得到同等效果
③关于option:savefirst savefp(f)的解释
The savefirst option requests that the individual first-stage regressions be saved for later access using the estimates command.  If saved, they can also be displayed using first or ffirst and the ivreg2 replay syntax.  The regressions are saved with the prefix "_ivreg2_", unless the user specifies an alternative prefix with the savefprefix(prefix) option.  The savesfirst and savesfprefix(prefix) options work similarly for the sfirst option if the user wishes to save the first-stage and reduced form estimations as a single estimated system.
savesfprefix(prefix)设置了结果的前缀。
④添加option:cluster(city)时,出现报错insufficient observations,可能和数据中个体或者变量比较多有关,不是很清楚,但不聚类的话可以计算出来。


这是对楼主命令的一些反馈,供参考。
二维码

扫码加我 拉你入群

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

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

2022-5-19 21:25:39
nk0987 发表于 2022-5-19 20:23
f+你的核心解释变量
我还想问下怎么报告F值和KP值
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群