I'm running many glm models in R (negative binomial regression to be specific) to a fairly large dataset (N = 175,000) with the intention of performing a specification curve analysis. For my case, this includes running simple, single-variable model specifications (e.g., glm.nb(y ~ x, data)
) as well as specifications with up to 8 control variables (e.g., glm.nb(y ~ x + a + b + c + d + e + f + g + h, data)
). My x
and y
are count variables and my controls are a mix of binary and count variables.
In the process of running these models I have occasionally been given the error, Warning message: glm.fit: algorithm did not converge
. I have fixed this in the past my increasing the maximum number of iterations (e.g., glm.nb(y ~ x + a + b + c + d + e + f + g + h, data, maxit = 1000)
), but I still get the error sometimes. However, the model is still producing results, which seem pretty sensible when compared to the results of models that do not produce the error message.
What does it mean when glm gives the error but still produces results? Are the results invalid?