DHARMa

Simulation-based residual diagnostics for generalized linear mixed models and other hierarchical regression models.

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.

  1. Fear of humans as apex predators has landscape‐scale impacts from mountain lions to mice Justin P. Suraci et al. (2019), Ecology Letters · 466 citations
  2. Ecological memory modifies the cumulative impact of recurrent climate extremes Terry P. Hughes et al. (2018), Nature Climate Change · 410 citations
  3. sdmTMB : An R Package for Fast, Flexible, and User-Friendly Generalized Linear Mixed Effects Models with Spatial and Spatiotemporal Random Fields Sean C. Anderson et al. (2025), Journal of Statistical Software · 211 citations
  4. Shape, size, and polymer dependent effects of microplastics on Daphnia magna Michael Schwarzer et al. (2021), Journal of Hazardous Materials · 192 citations
  5. Measuring biodiversity from DNA in the air Elizabeth L. Clare et al. (2022), Current Biology · 190 citations

All 14,408 citing works on Google Scholar →