全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1612 1
2012-11-06
悬赏 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 ...
二维码

扫码加我 拉你入群

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

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

全部回复
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
**************
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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