I am trying to run a negative binomial model in R. I am looking to use AGE (continuous), GENDER (two dummy codes for male and other), and race (two dummy codes for African American and other) to predict an outcome with many zeros.
I created the interaction terms manually and am trying to run the NB testing out 16 total predictors , including the two-way and three-way interaction terms. But my model won't run. I keep getting the error message:
Error in optim(fn = loglikfun, gr = gradfun, par = c(start$count, start$zero, :
non-finite value supplied by optim
In addition: Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
I think there is some error in the interaction terms, but I'm not sure how else to create the terms besides multiple the variable combinations themselves (AGE X GENDER (0-female, 1-male, for example).
Would anyone know how to get the model to run, such that I can look at the combinations of the continuous AGE variable by the other categorical ones? Thank you!