I'm trying to make a GLM with binomial distribution to evaluate the effect of the diameter at breast height and the occupation of tree termites in species of tree.
I'm using the following model:
model <- glm(ocupation ~ dap * specie, data = termites, family = binomial(link = logit))
My response variable is the occupation of termites on the tree (data of absence and presence); the independent variable is the dap and the interaction with kind of species.
But when I run the model the following errors appear:
Warning message:
glm.fit: odds adjusted numerically 0 or 1 occurred
Error in seq.default(1, length(levels(eval(as.name(qvar)))) - 1, by = 1) :
wrong sign in 'by' argument
Error in solve.default(t(X) %*% W %*% X) :
system is computationally singular: reciprocal condition number = 1.93217e-38
>
Warning messages:
1: not plotting observations with leverage one:
10, 24, 26, 36, 37, 40, 43, 57, 71, 72, 73, 116, 138
2: not plotting observations with leverage one:
10, 24, 26, 36, 37, 40, 43, 57, 71, 72, 73, 116, 138
3: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced
4: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced
The same thing happens when I rotate the contrasts in the analysis
Error in seq.default(1, length(levels(eval(as.name(qvar)))) - 1, by = 1) :
wrong sign in 'by' argument
Can someone help me? I understand very little about R.
dap
is diameter, as @EdM thinks, shall we assume that the research questions are something like 'what is the effect on infestation probability of having a larger diameter?' (a no interaction model), and then 'what is the increase of probability, if any, from what we would expect based on diameter due to being a particularly tasty or untasty species?' (an interaction model)? $\endgroup$