1750 3

[编程问题求助] stata做IV回归时,每当想输出F值,就会显示file /xxx.txt could not be opened [推广有奖]

  • 2关注
  • 0粉丝

已卖:3份资源

硕士生

7%

还不是VIP/贵宾

-

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

楼主
一份黄焖鸡米饭 发表于 2021-6-27 23:13:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
不管是ivregress 2sls 还是ivregress2 2sls 还是ivreghdfe,不输出F值时,outreg2可以运行并输出回归结果,但每当想输出F值的时候:
outreg2 using $table/xxx.doc, append addstat(First stage F-stat, e(widstat)) dec(4)


outreg2 using $table/xxx.doc, cttop(first) tstat tdec(3) bdec(3) word replace


adds(IV F-stat,`fstat')
outreg2 using $table/ols_5.doc, cttop(second) word

都会显示
file /xxx.txt could not be opened r(603);

不知道是什么原因
二维码

扫码加我 拉你入群

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

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

关键词:opened Stata Could tata Open

沙发
蓝色 发表于 2021-6-28 12:58:41
outreg2 using d:\ols_5.doc, cttop(second) word  adds(IV F-stat,`e(F)')

藤椅
蓝色 发表于 2021-6-28 12:59:28
. webuse hsng2
(1980 Census housing data)

. ivregress 2sls rent pcturban (hsngval = faminc i.region), small


Instrumental variables (2SLS) regression

      Source |       SS       df       MS         Number of obs   =         50
-------------+------------------------------      F(  2,    47)   =      42.66
       Model |  36677.4033     2  18338.7017      Prob > F        =     0.0000
    Residual |  24565.7167    47  522.674823      R-squared       =     0.5989
-------------+------------------------------      Adj R-squared   =     0.5818
       Total |    61243.12    49  1249.85959      Root MSE        =     22.862

------------------------------------------------------------------------------
        rent |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     hsngval |   .0022398   .0003388     6.61   0.000     .0015583    .0029213
    pcturban |    .081516   .3081528     0.26   0.793    -.5384074    .7014394
       _cons |   120.7065   15.70688     7.68   0.000     89.10834    152.3047
------------------------------------------------------------------------------
Instrumented:  hsngval
Instruments:   pcturban faminc 2.region 3.region 4.region

. outreg2 using d:\ols_5.doc, cttop(second) word  adds(IV F-stat,`e(F)')
d:\ols_5.doc
dir : seeout

.

板凳
一份黄焖鸡米饭 发表于 2021-7-11 06:26:50
蓝色 发表于 2021-6-28 12:59
. webuse hsng2
(1980 Census housing data)
谢谢,但是还是显示txt could not be opened r(603);

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

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