clearerrs/setmaxerrs
Posted: Mon May 07, 2012 12:57 pm
I have a code I wrote and successfully used a few weeks ago that estimates VAR/VEC for 246 datasets depending on whether the variables are cointegrated or not. I use setmaxerrs and clearerrs in multiple parts of the code to deal with errors I know can occur. Like I said everything worked fine a few weeks ago, now I am trying to rerun everything to finalize the results however I am getting errors saying that 'setmaxerrs (clearerrs) is not defined or an illegal command.' I will post a snippet of code, any suggestions would be greatly appreciated.
''****************************************** '''johansen cointegration test ************************************************
''coint
setmaxerrs 50
!old_count = @errorcount
!new_count = 0
scalar counter = 0
group g1 s3
for !j = 9 to 14 step 2
!old_count = @errorcount
g1.add s!j
freeze(coint_test!j) g1.coint(s,4)
!new_count = @errorcount
if !new_count > !old_count then
!old_count = @errorcount
freeze(coint_test!j) g1.coint(s,2)
endif
!new_count = @errorcount
if !new_count > !old_count then
!old_count = @errorcount
freeze(coint_test!j) g1.coint(s,1)
endif
!new_count = @errorcount
if !new_count > !old_count then
table(16,8) coint_test!j
endif
g1.drop s!j
next !j
clearerrs
''****************************************** '''johansen cointegration test ************************************************
''coint
setmaxerrs 50
!old_count = @errorcount
!new_count = 0
scalar counter = 0
group g1 s3
for !j = 9 to 14 step 2
!old_count = @errorcount
g1.add s!j
freeze(coint_test!j) g1.coint(s,4)
!new_count = @errorcount
if !new_count > !old_count then
!old_count = @errorcount
freeze(coint_test!j) g1.coint(s,2)
endif
!new_count = @errorcount
if !new_count > !old_count then
!old_count = @errorcount
freeze(coint_test!j) g1.coint(s,1)
endif
!new_count = @errorcount
if !new_count > !old_count then
table(16,8) coint_test!j
endif
g1.drop s!j
next !j
clearerrs