[R-sig-ME] DHARMa package diagnostic plots give different results

Alessandra Bielli b|e|||@@|e@@@ndr@ @end|ng |rom gm@||@com
Sat May 30 02:15:54 CEST 2020

Dear list.

I wonder if anyone has experience in using the DHARMa package for model

I am fitting a poisson GLMM of the type

glmer(captured ~ treatment + offset(log(Effort)) + (1|Trip_Code),
      data=x, family="poisson", glmerControl(optimizer = "bobyqa"))

where captured is a count and treatment is a categorical variable with two
levels (control and experiment). The dependent variable contains mainly
zeros (Fig 1).

I am running some diagnostic tests using the DHARMa package and I did not
detect any singularity, overdispersion or zero inflation.

When I check the quantile residuals plots though, using two different
methods a) and b) I obtain two different results.

a) simulationOutput <- simulateResiduals(fittedModel = m1)

b) testQuantiles(simulationOutput)

With method a) no significant quantile deviation is detected (Fig 2, right
plot), while it is detected with method b) (Fig 3). However, I was
expecting a) and b) to give the same results since the R documentation
for testQuantiles {DHARMa} explains:
"the quantile test is automatically performed in
## Not run:

I understand that method a) plots rank transformed model predictions, while
b) doesn't but I wouldn't think this affects the p-value, am I correct?
I also understand that method a) automatically adds some noise to the
residuals to maintain a uniform response (see:  integerResponse parameter).
Does method b) do the same? If it doesn't, could that be the reason for the
different results?

Many thanks,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig1.pdf
Type: application/pdf
Size: 4436 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20200529/1db2cd05/attachment-0003.pdf>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig2.pdf
Type: application/pdf
Size: 38202 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20200529/1db2cd05/attachment-0004.pdf>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig3.pdf
Type: application/pdf
Size: 31505 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20200529/1db2cd05/attachment-0005.pdf>

More information about the R-sig-mixed-models mailing list