楼主: deniszzk
10127 6

[编程问题求助] ivreg2 各种工具变量回归test的结果如何保存 [推广有奖]

  • 8关注
  • 20粉丝

已卖:2686份资源

博士生

70%

还不是VIP/贵宾

-

威望
0
论坛币
6719 个
通用积分
1.4879
学术水平
27 点
热心指数
33 点
信用等级
13 点
经验
6489 点
帖子
193
精华
0
在线时间
438 小时
注册时间
2009-6-21
最后登录
2024-12-4

楼主
deniszzk 学生认证  发表于 2017-2-5 22:09:41 |AI写论文
50论坛币
请教论坛各位大神,ivreg2里面iv的各种检验的test的结果,比如underindentification/Hansen. J stat/ First-stage F值/ Chi-sq(1)(p value)可以直接输出吗?比如用outreg2?谢谢大神!

最佳答案

蓝色 查看完整内容

看 outreg2的example 9 里面的例子 如果ivreg2有保留值,可以直接导出 如果没有就自己计算导出 Example 9. Adding r( ) e( ) scalars Additional statistics may be added with addstat( ) or addtext( ). Values stored in macros r( ), e( ), or s( ) can be included directly. You can see what values are available by typing ereturn list or return list. To test the equality of two ...
关键词:IVREG 工具变量 test IVR Est 如何
已有 1 人评分经验 论坛币 收起 理由
happy_287422301 + 100 + 20 鼓励积极发帖讨论

总评分: 经验 + 100  论坛币 + 20   查看全部评分

无敌的价格机制

沙发
蓝色 发表于 2017-2-5 22:09:42
看 outreg2的example 9 里面的例子
如果ivreg2有保留值,可以直接导出
如果没有就自己计算导出

Example 9. Adding r( ) e( ) scalars

    Additional statistics may be added with addstat( ) or addtext( ).
    Values stored in macros r( ), e( ), or s( ) can be included directly.
    You can see what values are available by typing ereturn list or
    return list.

    To test the equality of two of the estimated coefficients and report
    the results in the table, note that test will sometimes return
    chi-squared, then you would instead use addstat(chi-square test,
    r(chi2)):


    reg mpg foreign weight length
    test foreign length
    outreg2 using myfile, adds(F-test, r(F), Prob > F, `r(p)') replace
    seeout

    To add results of lincom postestimation command to a table:

    sysuse auto, clear
    reg price mpg rep78 head
    lincom mpg + rep
    local tstat=r(estimate)/r(se)
    local pval = tprob(r(df), abs(`tstat'))
    outreg2 using "myfile", adds(joint, r(estimate), t-stat, `tstat',
          p-val,`pval') replace see

    In some cases it is better to save the value of a previously
    calculated statistic in a local macro and then put that into addstat(
    ):


    regress mpg rep78 headroom
    test rep78
    local F1 = r(F)
    test headroom
    outreg2 using 2test, addstat(Test1 F, `F1', Test2 F, `r(F)')


    If it is missing, outreg2 will automatically calculate e(p), which is
    presumably the F-test or chi-square-test of significance of a
    regression.


    outreg2 using myfile, addstat(F test, e(p))


    Another example would be to report a pseudo R-squared after a logit
    estimation, which outreg2 does not otherwise report.


    logit foreign price trunk weight
    outreg2 using myfile, addstat(Pseudo R-squared, `e(r2_p)')




已有 2 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
deniszzk + 5 + 2 + 2 + 2 讲解很清楚,谢谢!
happy_287422301 + 100 + 60 + 2 热心帮助其他会员

总评分: 经验 + 100  论坛币 + 65  学术水平 + 2  热心指数 + 4  信用等级 + 2   查看全部评分

藤椅
deniszzk 学生认证  发表于 2017-2-6 22:09:22
求大神帮助啊。

板凳
deniszzk 学生认证  发表于 2017-2-7 10:32:02 来自手机
蓝色 发表于 2017-2-6 22:46
看 outreg2的example 9 里面的例子
如果ivreg2有保留值,可以直接导出
如果没有就自己计算导出
谢谢

报纸
qingwa2016 发表于 2020-7-8 16:55:15
deniszzk 发表于 2017-2-6 22:09
求大神帮助啊。
请问你会添加Hansen. J stat了吗?

地板
小明jill 发表于 2020-8-17 16:28:25
qingwa2016 发表于 2020-7-8 16:55
请问你会添加Hansen. J stat了吗?
ivreg2回归直接就有这个结果

7
我要我的滋味sd 发表于 2024-1-14 12:00:50
小明jill 发表于 2020-8-17 16:28
ivreg2回归直接就有这个结果
请问

ivreg2和ivreg有何区别?

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

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