Package: DHARMa 0.5.0
DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models
"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', 'spaMM', and 'brms' (simple models); 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, temporal and phylogenetic autocorrelation."
Authors:
DHARMa_0.5.0.tar.gz
DHARMa_0.5.0.zip(r-4.7)DHARMa_0.5.0.zip(r-4.6)DHARMa_0.5.0.zip(r-4.5)
DHARMa_0.5.0.tgz(r-4.6-any)DHARMa_0.5.0.tgz(r-4.5-any)
DHARMa_0.5.0.tar.gz(r-4.7-any)DHARMa_0.5.0.tar.gz(r-4.6-any)
DHARMa_0.5.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
card.svg |card.png
DHARMa/json (API)
NEWS
| # Install 'DHARMa' in R: |
| install.packages('DHARMa', repos = c('https://staffanbetner.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/florianhartig/dharma/issues
- hurricanes - Hurricanes
glmmregressionregression-diagnosticsresidual
Last updated from:948ccf5402. Checks:1 ERROR, 8 OK. Indexed: no.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-x86_64 | ERROR | 422 | ||
| source / vignettes | OK | 271 | ||
| linux-release-x86_64 | OK | 282 | ||
| macos-release-arm64 | OK | 183 | ||
| macos-oldrel-arm64 | OK | 114 | ||
| windows-devel | OK | 303 | ||
| windows-release | OK | 229 | ||
| windows-oldrel | OK | 214 | ||
| wasm-release | OK | 184 |
Exports:benchmarkRuntimecreateDatacreateDHARMagetDatagetFamilygetFittedgetFixedEffectsgetObservedResponsegetPearsonResidualsgetPredictorNamesgetQuantilegetRandomStategetRefitgetResidualsgetSimulationsoutliersplotConventionalResidualsplotQQunifplotResidualsplotResidualsAllplotSimulatedResidualsrecalculateResidualsrunBenchmarkssimulateLRTsimulateResidualstestCategoricaltestDispersiontestGenerictestOutlierstestOverdispersiontestOverdispersionParametrictestPhylogeneticAutocorrelationtestQuantilestestResidualstestSimulatedResidualstestSpatialAutocorrelationtestTemporalAutocorrelationtestUniformitytestZeroInflationtransformQuantiles
Dependencies:apeaskpassbase64encbootbslibcachemclicodetoolscommonmarkcpp11crosstalkcurldata.tabledigestdoParalleldplyrevaluatefarverfastmapfontawesomeforeachfsgapgap.datasetsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttpuvhttrisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclelme4lmtestmagrittrMASSMatrixmemoisemgcvmimeminqanlmenloptropensslotelpillarpkgconfigplotlyplyrpromisespurrrqgamR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackreformulasrlangrmarkdownS7sassscalesshinysourcetoolsstringistringrsystibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunxtableyamlzoo
DHARMa for Bayesians
Rendered fromDHARMaForBayesians.Rmdusingknitr::rmarkdownon May 28 2026.Last update: 2026-05-12
Started: 2021-01-26
DHARMa: residual diagnostics for hierarchical (multi-level/mixed) regression models
Rendered fromDHARMa.Rmdusingknitr::rmarkdownon May 28 2026.Last update: 2026-05-28
Started: 2016-08-11
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models | DHARMa-package DHARMa |
| Benchmark runtimes of several functions | benchmarkRuntime |
| Simulate test data | createData |
| Create a DHARMa object from hand-coded simulations or Bayesian posterior predictive simulations. | createDHARMa |
| Get model data | getData getData.brmsfit getData.default getData.merMod |
| Get model family | getFamily getFamily.default getFamily.phyloglm getFamily.phylolm |
| Get fitted/predicted values | getFitted getFitted.brmsfit getFitted.default getFitted.gam getFitted.HLfit getFitted.MixMod getFitted.phyloglm getFitted.phylolm |
| Extract fixed effects of a supported model | getFixedEffects getFixedEffects.brmsfit getFixedEffects.default getFixedEffects.MixMod |
| Get model response | getObservedResponse getObservedResponse.default getObservedResponse.HLfit getObservedResponse.phyloglm getObservedResponse.phylolm |
| Get Pearson residuals | getPearsonResiduals getPearsonResiduals.brms getPearsonResiduals.default getPearsonResiduals.gam |
| Get predictor names | getPredictorNames getPredictorNames.default getPredictorNames.MixMod |
| Calculate Residual Quantiles | getQuantile |
| Record and restore a random state | getRandomState |
| Get model refit | getRefit getRefit.brmsfit getRefit.default getRefit.glmmTMB getRefit.HLfit getRefit.lm getRefit.MixMod getRefit.phyloglm getRefit.phylolm |
| Get model residuals | getResiduals getResiduals.brmsfit getResiduals.default getResiduals.MixMod |
| Get model simulations | getSimulations getSimulations.brmsfit getSimulations.default getSimulations.gam getSimulations.glmmTMB getSimulations.HLfit getSimulations.merMod getSimulations.MixMod getSimulations.negbin getSimulations.phyloglm getSimulations.phylolm |
| Histogram of DHARMa residuals | hist.DHARMa |
| Hurricanes | hurricanes |
| Return outliers | outliers |
| DHARMa standard residual plots | plot.DHARMa |
| Plots DHARMa benchmarks | plot.DHARMaBenchmark |
| Conventional residual plot | plotConventionalResiduals |
| Quantile-quantile plot for a uniform distribution | plotQQunif |
| Generic res ~ pred scatter plot with spline or quantile regression on top | plotResiduals |
| Create multiple residual plots simultaneously. | plotResidualsAll |
| DHARMa standard residual plots (deprecated) | plotSimulatedResiduals |
| Print simulated residuals | print.DHARMa |
| Recalculate residuals with grouping | recalculateResiduals |
| Return residuals of a DHARMa simulation | residuals.DHARMa |
| Benchmark calculations | runBenchmarks |
| Simulated likelihood ratio tests for (generalized) linear mixed models | simulateLRT |
| Create simulated residuals | simulateResiduals |
| Test for categorical dependencies | testCategorical |
| DHARMa dispersion tests | testDispersion |
| Test for a generic summary statistic based on simulated data | testGeneric |
| Test for outliers | testOutliers |
| Simulated overdisperstion tests (deprecated) | testOverdispersion |
| Parametric overdisperstion tests (deprecated) | testOverdispersionParametric |
| Plot distribution of p-values. | testPDistribution |
| Test for phylogenetic autocorrelation | testPhylogeneticAutocorrelation |
| Test for quantiles | testQuantiles |
| DHARMa general residual test | testResiduals |
| Residual tests | testSimulatedResiduals |
| Test for distance-based spatial (or similar type) autocorrelation | testSpatialAutocorrelation |
| Test for temporal autocorrelation | testTemporalAutocorrelation |
| Test for overall uniformity | testUniformity |
| Tests for zero-inflation | testZeroInflation |
| Transform quantiles to pdf (deprecated) | transformQuantiles |
