I have conducted a study observing the habitat preference of two different species of beetle. In the experiment, the beetle was placed in an arena with four habitat choices. The response variable was the proportion of time spent in each area. The explanetory variables are species, time of day, and size of beetle.
I am now struggling a lot with the statistical analysis of this data. I have decided to split the data into the four habitat types, then perform 4 tests to see the effects of species, time of day and size on the proportion of time spent in that specific habitat. My data is zero-inflated, and in some cases one-inflated too. A result of 0% time spent in a habitat is still a result, so I do not want to disregard this data. I have also realised that 0% time in a habitat is not a special case, and therefore shouldn’t be treated differently to my other values. I do not feel comfortable transforming the data e.g. making the 0 values 0.0001.
Following this an a lot of googling, I’ve decided a zero-one inflated beta regression is suitable and I have decided to use the zoib package for this (https://cran.r-project.org/web/packages/zoib/zoib.pdf)
I have now tried running the code, but I am not very experienced in R or statistics so am unclear on what certain parts of the code mean.
I don’t have access to the size data yet, but here is my current code. Family is equivelent to species.
modelbeetle <- zoib(Proportion ~ Family*Time|1|Family*Time|1, data = split$Cardboard)
To be honest, I’m not sure what the |1 means, and why i have to repeat Family*Time.
When i look at the help option, i get this:
zoib(model, data, n.response=1, joint = TRUE,
zero.inflation = TRUE, one.inflation = TRUE,
random = 0, EUID, link.mu = "logit", link.x0 = "logit",
link.x1 = "logit", prec.int = matrix(1e-3, n.response, 4),
prior.beta = matrix("DN", n.response, 4),
prec.DN = matrix(1e-3, n.response, 4),
lambda.L2 = matrix(1e-3, n.response, 4),
lambda.L1 = matrix(1e-3, n.response, 4),
lambda.ARD = matrix(1e-3, n.response, 4), prior.Sigma = "VC.unif",
scale.unif = 20,scale.halfcauchy = 20,
n.chain = 2, n.iter = 5000, n.burn =200, n.thin = 2, inits=NULL, seeds=NULL)
This is all well and good, but I assume i should but zero.inflation and one.inflation as TRUE but beyond that I don’t know what any of the other commands mean.
TapirBoy44 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.