I have count data with a huge amount of excess zeros, so have been attempting to run a zero-inflated model with an interaction term ("*") between two independent variables.
When I run the following code (where "abundance" is my count dependent variable, and "sites" and "sub-sites" are 2 of my independent variables) ..:
zinb <- zeroinfl(abundance ~ sites*sub-sites, dist="negbin", link="logit" )
summary(zinb)
...I get the following error:
"Error in optim(fn = loglikfun, gr = gradfun, par = c(start$count, start$zero, : non-finite value supplied by optim".
A simplified version of my data looks something like this, where I have 3 "sites" (numbers), each with their own "sub-sites" (letters):
1A, 1B, 1C 2A, 2B, 2C 3A, 3B.
Note that I have A, B, C sub-sites for sites 1 and 2, though only A and B sub-sites for site 3.
If I remove all C sites from the dataset, the zero-inflated model works, so I assume the issue lies with the fact that I do not have any data for '3C'. However, it is important for my analysis that I keep the C sites in my dataset.
Is there any way I can continue using a zero-inflated model with my full dataset, whilst continuing to test for significance between "sites" and "sub-sites"?
I hope I have presented this clearly, and I would really appreciate your time. Thank you.