I want to run a zero-inflated negative binomial regression in R, but one of my variables exhibits quasi-complete separation and throws errors for both the negative binomial and logistic pieces. I've been using the zeroinfl()
function in the pscl
package:
pop_dense_zinb <-
zeroinfl(thing_count ~
dataset[["variable_causing_issues"]],
data = dataset,
dist = "negbin",
EM = TRUE)
Errors:
Warning: glm.fit: fitted rates numerically 0 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Error in glm.fitter(x = X, y = Y, w = w, start = start, etastart = etastart, :
NA/NaN/Inf in 'x'
What can I do (in general, and particularly in R)? Is there an R package that can handle penalized likelihood methods like Firth in a zero-inflated negative binomial regression? I don't want to toss this variable because it's the best predictor of the outcome, which makes a lot of sense empirically, as well.