I'm looking for a recommendation on what GLM I could do with non-integer data.
Brief background of what I am doing:
I'm wanting to combine calculated herbivory rates with abundance data, to compare total herbivory pressure across different sites. For my herbivory rates, I did a GLM where I used the bite counts, with sites as a factor and the length of observation (i.e. how long each individual was observed for when the bites were counted) as an offset. This was to compare bite rates between different species.
- This worked perfectly fine as I used a quasipoisson model and count data.
Next, I want to quantify the herbivory pressure on each site, but there are a couple of caveats. Firstly, different species have a different mass. So, instead of looking at just abundance of each species, I calculated their total biomass per repeat of each site (3 repeats, 7 sites). Next, I multiplied the total biomass of each species by its mean herbivory rate to get a value for herbivory pressure. Finally, I summed all of the herbivory pressure values for each repeat so that I get a total herbivory (exerted by all species combined).
Now, I have the total herbivory values, 3 repeats for 7 sites (total 21 values). The initial plan was to do an ANOVA, however my data violates the assumptions of homogeneity of residuals and normal distribution. I have tried transforming the data, SQRT makes it a little bit better (not much) and log+1 (I have 2 x 0 values) skews the data to the right.
With this data consisting of non-integers, my understanding is I can't do a Poisson/quasi-Poisson GLM... I have been looking at different families of GLMs and I considered Gamma but I'm reading conflicting things.
What statistical analysis (GLM?) would you recommend for this? I could do a Kruskall Wallis but I was hoping there may be something more appropriate.
Many thanks!
EDIT: Here is an example data set (slightly different values to my data)
Example<- structure(list(Example_Site = c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L,
3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), TotalPressure = c(90000L,
80000L, 35000L, 0L, 5000L, 42500L, 0L, 600L, 1900L, 10600L, 18966L,
200000L, 77000L, 12342L, 50000L, 3000L, 2000L, 2000L, 70L, 100L,
0L), Transect = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 21L, 20L), .Label = c("H1",
"H2", "H3", "HP1", "HP2", "HP3", "K1", "K2", "K3", "KB1", "KB2",
"KB3", "MC1", "MC2", "MC3", "N1.1", "N1.2", "N1.3", "N2.1", "N2.2",
"N2.3"), class = "factor"), Region = structure(c(1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
2L, 2L), .Label = c("A", "B"), class = "factor")), class = "data.frame", row.names = c(NA,
-21L))
this is the code that I used to generate the basic lm
model<-lm(TotalPressure~Site, data = example)
autoplot(model)
when I try to apply the boxcox transformation to the lm this is what I get
> boxcox_lm<-boxcox(model)
Error in boxcox.default(model) : response variable must be positive
> boxcox_lm1<-boxcox(1+(model))
Error in 1 + (model) : non-numeric argument to binary operator