I'm running 1000 models in a loop, but some are not converging. Does anyone know the code to save these errors, so I can look into them? Basically I have a model form that runs 1000 times based on a dataframe, and then I save the model coefficients. Though I get all 1000 model coefficients, I do get an error at the end that some did not converge.
Code:
for(i in 1:n_rand){
print(i)
modform <- formula(paste("RESPONSE ~",
colnames(dataframe)[(11+i)],"+(1|X)+(1|Y)"))
aaa <- lmer(modform, data=dataframe)
nullcoef_tab$COEFF[i] <- fixef(aaa)[2]
}