Displaying 1 result from an estimated 1 matches for "spboot".
Did you mean:
smpboot
2012 May 26
2
avoid error within for loop, try, trycatch, while, move to next iteration, unlist
...quot;try" function to do this and it partially works.
Here is the thing:
logitsboots <- function(x,y,Jbh) {
logitseb=0;logitspb=0;
for (j in 1:1) {
#some code here that has to do with random numbers that may or may not produce an error and calculates the values of two scalar quantities: spboots and seboots,
logitspb=log(spboots/(1-spboots))
logitseb=log(seboots/(1-seboots))
#assume that I only care about logitseb for the moment
}
list(lse=logitseb)
}
# Now the following works just fine:
res=0
for(bb in 1:100) {
res[bb] <- try(logitsboots(x,y,Jbh), TRUE)
}
az=unl...