This function performs a simulation-based test for over/underdispersion

1 2 | ```
testOverdispersion(simulationOutput, alternative = "overdispersion",
plot = F)
``` |

`simulationOutput` |
an object with simulated residuals created by |

`alternative` |
whether to test for "overdispersion", "underdispersion", or "both" (both reduces power) |

`plot` |
whether to plot output |

The function implements two tests, depending on whether it is applied on a simulation with refit = F, or refit = T.

If refit = F (not recommended), the function tests if the IQR of the scaled residuals deviate from the null hypothesis of a uniform distribution. Simulations show that this option is not properly calibrated and much less powerful than the parametric alternative `testOverdispersionParametric`

and even the simple `testUniformity`

, and therefore it's use is not recommended. A warning will be returned if the function is called.

If refit = T, the function compares the approximate deviance (via squared pearson residuals) with the same quantity from the models refitted with simulated data. It is much slower than the parametric alternative `testOverdispersionParametric`

, but simulations show that it is slightly more powerful than the latter, and more powerful than any other non-parametric test in DHARMa, and it doesn't make any parametric assumptions. However, given the computational cost, I would suggest that most users will be satisfied with the parametric overdispersion test.

`testSimulatedResiduals`

, `testSimulatedResiduals`

, `testZeroInflation`

, `testTemporalAutocorrelation`

, `testSpatialAutocorrelation`

, `testOverdispersionParametric`

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.