Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models
Get model response
Benchmark runtimes of several functions
Check dot operator
Check if the fitted model is supported by DHARMa
Check simulated data
Simulated overdisperstion tests
Parametric overdisperstion tests
Plot distribution of p-values.
Test for phylogenetic autocorrelation
Simulate test data
Create a DHARMa object from hand-coded simulations or Bayesian posteri...
DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Re...
Modified ECDF function.
Ensures that an object is of class DHARMa
Ensures the existence of a valid predictor to plot residuals against
Get model family
Get fitted/predicted values
Extract fixed effects of a supported model
Get Pearson residuals
get possible models
Calculate Residual Quantiles
Record and restore a random state
Get model refit
Get model residuals
Get model simulations
Histogram of DHARMa residuals
Return outliers
DHARMa standard residual plots
Plots DHARMa benchmarks
Conventional residual plot
Quantile-quantile plot for a uniform distribution
Generic res ~ pred scatter plot with spline or quantile regression on ...
DHARMa standard residual plots
Print simulated residuals
Recalculate residuals with grouping
Return residuals of a DHARMa simulation
Benchmark calculations
Simulated likelihood ratio tests for (generalized) linear mixed models
Create simulated residuals
Test for categorical dependencies
DHARMa dispersion tests
Test for a generic summary statistic based on simulated data
Test for outliers
Test for quantiles
DHARMa general residual test
Residual tests
Test for distance-based spatial (or similar type) autocorrelation
Test for temporal autocorrelation
Test for overall uniformity
Tests for zero-inflation
Transform quantiles to pdf (deprecated)
The 'DHARMa' package uses a simulation-based approach to create readily interpretable scaled (quantile) residuals for fitted (generalized) linear mixed models. Currently supported are linear and generalized linear (mixed) models from 'lme4' (classes 'lmerMod', 'glmerMod'), 'glmmTMB', 'GLMMadaptive', and 'spaMM'; phylogenetic linear models from 'phylolm' (classes 'phylolm' and 'phyloglm'); generalized additive models ('gam' from 'mgcv'); 'glm' (including 'negbin' from 'MASS', but excluding quasi-distributions) and 'lm' model classes. Moreover, externally created simulations, e.g. posterior predictive simulations from Bayesian software such as 'JAGS', 'STAN', or 'BUGS' can be processed as well. The resulting residuals are standardized to values between 0 and 1 and can be interpreted as intuitively as residuals from a linear regression. The package also provides a number of plot and test functions for typical model misspecification problems, such as over/underdispersion, zero-inflation, and residual spatial, phylogenetic and temporal autocorrelation.