DHARMa
Simulation-based residual diagnostics for generalized linear mixed models and other hierarchical regression models.
DocumentationGitHubCRANr-universe
Cited 14,408 times on Google Scholar, summed over its 9 entries there (as of 11 October 2026)
DHARMa (Diagnostics for HierArchical Regression Models) checks whether a fitted regression model is consistent with the data it was fitted to. For generalized linear and mixed models, raw residuals are hard to interpret. DHARMa instead simulates new data from the fitted model and uses them to compute scaled (quantile) residuals. These are standardized to values between 0 and 1 and can be read as intuitively as residuals from a linear regression.
Building on these residuals, the package provides plots and tests for typical
misspecification problems: over- and underdispersion, zero-inflation, and
residual spatial, temporal and phylogenetic autocorrelation. Supported are
models from lme4, glmmTMB, GLMMadaptive, spaMM, mgcv (GAMs), phylolm and
simple brms models, as well as lm and glm (including negative binomial
models from MASS). Simulations created elsewhere, for example posterior
predictive simulations from JAGS, Stan or BUGS, can be processed too.
Since 2024 the package has been extended in a project funded by the DFG; see Projects.
Authors: Florian Hartig (maintainer). Contributors: Lukas Lohse, Melina de Souza Leite, Cosmina Werneke.
How to cite DHARMa
Florian Hartig. DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models. R package.
doi:10.32614/CRAN.package.DHARMa.
For the citation of a specific version, run citation("DHARMa") in R.
Widely cited work citing DHARMa
The most-cited articles that cite DHARMa, ranked by their own citation count in OpenAlex; the group's own papers are left out.
- Fear of humans as apex predators has landscape‐scale impacts from mountain lions to mice
- Ecological memory modifies the cumulative impact of recurrent climate extremes
- sdmTMB : An R Package for Fast, Flexible, and User-Friendly Generalized Linear Mixed Effects Models with Spatial and Spatiotemporal Random Fields
- Shape, size, and polymer dependent effects of microplastics on Daphnia magna
- Measuring biodiversity from DNA in the air