Have created a GLMM model and plotted the predicted probabilities of each factor. However, I cannot fathom how to create confidence intervals using the BootMer function. I keep getting the error message cannot simulate from non integer prior weights. I'm hoping someone would be able to help? Thanks in advance.
glmm1 <- glmer(cbind(Total_Dead, Total_Collected - Total_Dead) ~
Species + timeseries + (1|Location),
data = dat, family= "binomial")
dat$timeseries <- dat$Study_Date - 1998
plot(predict(glmm1, data.frame(Species="An. Arab", timeseries= dat$timeseries),
type="response", re.form = NA) ~
dat$timeseries, frame=FALSE, bty="n", pch="", xaxt="n", ylim=c(0, 0.5),
ylab="Predicted mortality", xlab="Year",
main = "Predicted mortality by species",
cex.lab=1.6, yaxt="n")
axis(1, at=c(1:17), labels=1999:2015, cex.axis=1.8)
axis(2, las=2, at=seq(0, 1, 0.2), labels=seq(0, 1, 0.2), cex.axis=1.8)
COLS <- c("blue", "red", "purple", "aquamarine3", "orange")
PCH <- c(17, 15, 19, 20, 5)
for(i in 1:length(unique(levels(dat$Species)))){
points((dat$Total_Dead[dat$Species == levels(dat$Species)[i]] /
dat$Total_Collected[dat$Species == levels(dat$Species)[i]]) ~
dat$timeseries[dat$Species == levels(dat$Species)[i]],
pch=PCH[i], col=COLS[i])
lines(predict(glmm1, data.frame(Species=levels(dat$Species)[i],
timeseries = dat$timeseries), type="response",
re.form = NA) ~ dat$timeseries, lty=4, col=COLS[i])
}
bootstrap <- bootMer(x=glmm1, FUN= fixef, nsim=200)