After running this negative binomial model:
test_nb <- glm.nb(low_lvl_deaths ~ CSO_prtcpt + IMR + ethnic_frac + democracy + cumulative_intensity + PKO + war_duration + territory + peace_agg + con_complex + lGDPpc, data = nb_outliers)
I am met with the following error:
Error in glm.fitter(x = X, y = Y, w = w, etastart = eta, offset = offset, : NA/NaN/Inf in 'x'
To my knowledge, this error implies that I have Na/NaN/Infinite values somewhere in my data set. After investigating each of these possibilities, I have only found that my data set contains NA values. Even when running this model with NAs excluded, I am still met with this error. Proceeding from here, I decided to remove one covariate at a time to isolate which variable was causing this error. I eventually found that the peace_agg variable was the culprit. However, this is interesting to me for a number of reasons.
First, I investigated this variable in particular and found no NA, Nan, or Infinite values. Second, I ran this exact model as a Poisson model rather than a negative binomial and I found no such issue. Further, because I am running survival analysis with the exact same set of covariates, no such error arose with the same variables in a Cox model. In summary, it seems that the variable causing this error does not contain NA/Nan/Inf values as the error suggests. Secondly, this exact same model can run in other contexts, so long as it is not being estimated as a negative binomial. Given the complexity of this issue, I am trying to figure out just what exactly is preventing this model from running.