0

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.

Reece
  • 1
  • Have you done the exploratory analysis into your data? How does site C differ from other sites in terms of mean, range, percentage of zeros...? – Roman Luštrik Apr 20 '21 at 11:51
  • @RomanLuštrik Thanks for your reply. Min, Max, Mean and % of Zeros are all similar between sites A, B and C. The only major difference is the amount of data I have per site, ie. Site A has 870 counts, B has 860 and C has 120.. could this be the issue? – Reece Apr 20 '21 at 15:52
  • Hum, maybe. You could test if small sample-number of zeros is the culprit here. What you could do is replace some zeros in the small samples with some positive random value. Maybe vary how many you replace to see if you can estimate the parameters. – Roman Luštrik Apr 21 '21 at 05:15

0 Answers0