Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models
Benchmark runtimes of several functions
Check dot operator
Check if the fitted model is supported by DHARMa
Check simulated data
Simulate test data
Create a DHARMa object from hand-coded simulations or Bayesian posteri...
Modified ECDF function
DHARMa - Residual Diagnostics for HierArchical (Multi-level / Mixed) R...
Ensures that an object is of class DHARMa
Ensures the existence of a valid predictor to plot residuals against
Get fitted / predicted values
Extract fixed effects of a supported model
Get model response
get possible models
calculate 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
Generic simulation test of a summary statistic
Test for outliers
Simulated overdisperstion tests
Parametric overdisperstion tests
Plot distribution of p-values
Test for quantiles
DHARMa general residual test
Residual tests
Test for distance-based (spatial, phylogenetic or similar) autocorrela...
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', 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 and temporal autocorrelation.