I'm running into trouble while checking the robustness of a GLM using the bootstrap procedures in R. Basically I want to check whether the estimated coefficient estimates of an existing GLM that I've built before are consistent and robust for my data.
The model fit is usually pretty consistent and nice, but every once in a while (0.5% of the cases), the model doesn't convergence for some reason or another. The end result is that I can't get decent bootstrap statistics and so forth. Is there a known solution for this in literature? Here's what I tried in R:
statfun <- function(formula, data, indices) {
d <- data[unique(indices),] # allows boot to select sample
fit <- glm(formula, data=d,family="binomial")
if(!fit$converged) {
return(NULL) #ignore this fit? this doesn't work ...
}
return(coef(fit))
}
# bootstrapping with 1000 replications
results <- boot(data=df, statistic=statfun,R=1000, formula=form)
Update: This data contains about 4500 rows, 11 columns, 3 of which are dummies and thus have repeated entries quite often (2 covar and the dependent var). I checked whether in any sample iteration those dummies are exclusively restricted to one value, to which the answer is negative.