This function performs a simulation-based test for over/underdispersion
testOverdispersion(simulationOutput, alternative = "overdispersion",
plot = F)
a DHARMa object with simulated residuals created with simulateResiduals
whether to test for "overdispersion", "underdispersion", or "both" (both reduces power)
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