I am trying to determine what factors best predict/explain where deer fawns are being killed by predators based on the kill site's distance to clear-cuts (which I've grouped into three different age categories as well as a overall distance to all of the clear cuts:
distcut_all, distcut_0to5, distcut_6to10, distcut_11to15) as well as a distance to the nearest trail (
dist_trail). Finally, also have included a categorical habitat covariate (
hab), which signifies with habitat type is most prevalent in a buffer around each kill site. I have about 300 actual kill sites (coded "1") and about 300 random "false" kill sites (coded "0"), given the name "event_code". I am using a mixed effects model because these kill sites are from 20 different individual animals and therefore are not all independent of each other (i.e., each kill site (or trial) is not a unique occurrence independent of each other kill for a given individual predator).
I ran a for() loop for all of my numeric covariates to calculate a z score because my "distance to" measurements are on different scales, with some being very small, like 1 meter, and some being 4000 meters aways (which I relabeled covariateNorm, see code below).
I have run the following code with "animal" as a mixed effect. You'll also noticed that I have include logit link:
glmm.1<-glmer(event_code~distcut_allNorm+hab+distcut_0to5Norm+distcut_6to10Norm+discut_11to15Norm+dist_trailNorm+(1|animal), family=binomial(link = "logit"), data=fawnkill,)
and I get the following error:
Error: Response is constant
I can find close to nothing online about why this error is occurring. Also, I would also ask that if anyone sees any errors in my thought process for doing this analysis, your advice is welcome.