楼主: econfj
1646 1

panel data按每家公司做一个回归,其中有一家出错,怎么使得程序继续进行下去? [推广有奖]

  • 1关注
  • 3粉丝

已卖:2份资源

教授

19%

还不是VIP/贵宾

-

威望
0
论坛币
32534 个
通用积分
28.9504
学术水平
1 点
热心指数
5 点
信用等级
2 点
经验
1020 点
帖子
456
精华
0
在线时间
1621 小时
注册时间
2010-4-2
最后登录
2022-7-14

楼主
econfj 发表于 2012-11-6 01:22:15 |AI写论文
300论坛币
panel data按每家公司做一个回归,其中有一家出错,怎么使得程序继续进行下去?

比方说,有1000家公司,运行到第八家的时候,出现错误信息
Warning: convergence not achieved
r(430);

end of do-file

r(430);

同时程序中止。

请问,怎么使得使得程序继续进行下去,并且记录出错的公司编号(变量gvkey)?
非常感谢!

最佳答案

大白菜2012 查看完整内容

1. nostop Syntax {do|run} filename [arguments] [, nostop ] nostop allows the do-file to continue executing even if an error occurs. Normally, Stata stops executing the do-file when it detects an error (nonzero return code). 2. capture ************** clear* inp x 1 2 2 2 end gen error=0 forv i=1/4{ capt assert x==1 in `i' di in red _rc replace er ...
关键词:panel data Panel Data pane Convergence 程序 公司

沙发
大白菜2012 发表于 2012-11-6 01:22:16
1. nostop

Syntax

        {do|run} filename [arguments] [, nostop ]

nostop allows the do-file to continue executing even if an error occurs.
        Normally, Stata stops executing the do-file when it detects an error
        (nonzero return code).

2. capture

**************
clear*
inp x
1
2
2
2
end
gen error=0
forv i=1/4{
capt assert x==1 in `i'
di in red _rc
replace error=_rc in `i'
}
l
**************
元芳,侬怎么L00K?

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

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