Reputation: 11
I'm trying to fit a ZIP (Zero inflated Regression Model) to my dataset which contains 4 predictors. The dependent variable is 60% full of zeros which fits the model assumption. 2 of my 4 predictors might be correlated (fluctuating between 0.5-0.8). I however really need to predict based on ALL 4 predictors, is there a way around this? Or might this error "non-finite value supplied by optim" not be related to the correlation? If I drop a variable, the model is running which leads me to believe it is due to correlation.
This is how my data is looking like:
head(data_new)
# A tibble: 6 × 6
rownum A B C D E
<int> <int> <dbl> <dbl> <dbl> <dbl>
1 1 266 0.766 0.0519 0.0260 0.156
2 2 97 1 0 0 0
3 3 508 0.675 0.214 0.0256 0.0855
4 4 4 0.762 0.167 0 0.0714
5 5 70 0.796 0.122 0 0.0816
6 6 51 0.757 0.203 0 0.0405
I want to fit a regression based on "A", however B and C are the ones that might have correlation.
Running
zip_model <- zeroinfl(A ~ B + C + D + E, data = data_new, dist = "poisson")
returns Error in optim(fn = loglikfun, gr = gradfun, par = c(start$count, start$zero, : non-finite value supplied by optim
Upvotes: 1
Views: 124