Issue with dharma diagnostics glmm

14 Views Asked by At

This is my first time running a binomial GLMM and it seems to be fine. However, when checking for the model assumptions using the dharma package, I find a pattern in the residuals. After reading the dharma package documentation, I found out that some solutions include transforming data or include apply JAGs. It is not very clear to me how to deal with JAGs.

Having said that, my questions are two.

  1. All the other model assumptions seem to be fine, therefore this pattern found in the residuals makes the model invalid?

  2. If necessary to use JAGs, is there any suggested documentation? I have found this information, but if somebody knows some other suggested source it would be great.

MAny thanks

data available at: https://docs.google.com/spreadsheets/d/1MqgL90vjA3sDXt0tm7P587Kn-k-UFYR0RJALW4XHIDw/edit?usp=sharing#Download data
datosopi<- read.delim("clipboard", dec=",")#Use after copy data from file
str(datosopi)
datosopi$Localidad=as.factor(datosopi$Localidad)
datosopi$Estacion=as.factor(datosopi$Estacion)
datosopi$trampa=as.factor(datosopi$trampa)
datosopi$msp=as.factor(datosopi$msp)
str(datosopi)
mnb1 <- glmer.nb(abundancia ~ Estacion*msp+Localidad+ (1 |trampa), data=datosopi,control = glmerControl(optCtrl=list(maxfun=1e6)))
library(DHARMa)
residh <- simulateResiduals(mnb1)
plot(residh)
testDispersion(mnb1)
shapiro.test(residuals(mnb1))
0

There are 0 best solutions below