DHARMa

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

Downloads per year

1,054,263 downloads from the Posit (RStudio) CRAN mirror since 2016, through 28 October 2026

Cited 14,692 times on Google Scholar, summed over its 9 entries there (as of 29 October 2026)

DHARMa (Diagnostics for HierArchical Regression Models) checks whether a fitted regression model is consistent with the data it was fitted to. For generalised 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 standardised 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 the project page.

Questions, bug reports and feature requests: see the CRAN page and use the issue tracker linked there under “BugReports”.

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.

Citations

DHARMa has been cited 14,692 times on Google Scholar as of 29 October 2026. Scholar lists the package under 9 separate entries, for example for different versions; the total adds them up. The chart shows how they are distributed over the years, as of 19 October 2026; the 2026 figure covers the year up to that date.

Citations per year

Widely cited work citing DHARMa

The most-cited articles that cite DHARMa, ranked by their own citation count in OpenAlex as of 29 October 2026; 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 · 467 citations
  2. Ecological memory modifies the cumulative impact of recurrent climate extremes Terry P. Hughes et al. (2018), Nature Climate Change · 412 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 · 214 citations
  4. Measuring biodiversity from DNA in the air Elizabeth L. Clare et al. (2022), Current Biology · 187 citations
  5. Shape, size, and polymer dependent effects of microplastics on Daphnia magna Michael Schwarzer et al. (2021), Journal of Hazardous Materials · 185 citations

All citing works on Google Scholar →