Package: DHARMa 0.4.6.1

DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models

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.

Authors:Florian Hartig [aut, cre], Lukas Lohse [ctb]

DHARMa_0.4.6.1.tar.gz
DHARMa_0.4.6.1.zip(r-4.5)DHARMa_0.4.6.1.zip(r-4.4)DHARMa_0.4.6.1.zip(r-4.3)
DHARMa_0.4.6.1.tgz(r-4.4-any)DHARMa_0.4.6.1.tgz(r-4.3-any)
DHARMa_0.4.6.1.tar.gz(r-4.5-noble)DHARMa_0.4.6.1.tar.gz(r-4.4-noble)
DHARMa_0.4.6.1.tgz(r-4.4-emscripten)DHARMa_0.4.6.1.tgz(r-4.3-emscripten)
DHARMa.pdf |DHARMa.html
DHARMa/json (API)
NEWS

# Install 'DHARMa' in R:
install.packages('DHARMa', repos = c('https://florianhartig.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/florianhartig/dharma/issues

Datasets:

On CRAN:

glmmregressionregression-diagnosticsresidual

37 exports 204 stars 7.60 score 94 dependencies 9 dependents 194 mentions 2.6k scripts 9.9k downloads

Last updated 14 hours agofrom:610b12bea6. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 17 2024
R-4.5-winOKSep 17 2024
R-4.5-linuxOKSep 17 2024
R-4.4-winOKSep 17 2024
R-4.4-macOKSep 17 2024
R-4.3-winOKSep 17 2024
R-4.3-macOKSep 17 2024

Exports:benchmarkRuntimecreateDatacreateDHARMagetFamilygetFittedgetFixedEffectsgetObservedResponsegetPearsonResidualsgetQuantilegetRandomStategetRefitgetResidualsgetSimulationsoutliersplotConventionalResidualsplotQQunifplotResidualsplotSimulatedResidualsrecalculateResidualsrunBenchmarkssimulateLRTsimulateResidualstestCategoricaltestDispersiontestGenerictestOutlierstestOverdispersiontestOverdispersionParametrictestPhylogeneticAutocorrelationtestQuantilestestResidualstestSimulatedResidualstestSpatialAutocorrelationtestTemporalAutocorrelationtestUniformitytestZeroInflationtransformQuantiles

Dependencies:apeaskpassbase64encbootbslibcachemclicodetoolscolorspacecommonmarkcpp11crayoncrosstalkcurldata.tabledigestdoParalleldplyrevaluatefansifarverfastmapfontawesomeforeachfsgapgap.datasetsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttpuvhttrisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclelme4lmtestmagrittrMASSMatrixmemoisemgcvmimeminqamunsellnlmenloptropensslpillarpkgconfigplotlyplyrpromisespurrrqgamR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackrlangrmarkdownsassscalesshinysourcetoolsstringistringrsystibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunxtableyamlzoo

DHARMa for Bayesians

Rendered fromDHARMaForBayesians.Rmdusingknitr::rmarkdownon Sep 17 2024.

Last update: 2022-09-08
Started: 2021-01-26

DHARMa: residual diagnostics for hierarchical (multi-level/mixed) regression models

Rendered fromDHARMa.Rmdusingknitr::rmarkdownon Sep 17 2024.

Last update: 2024-09-11
Started: 2016-08-11

Readme and manuals

Help Manual

Help pageTopics
Benchmark runtimes of several functionsbenchmarkRuntime
Simulate test datacreateData
Create a DHARMa object from hand-coded simulations or Bayesian posterior predictive simulations.createDHARMa
Get model familygetFamily getFamily.default getFamily.phyloglm getFamily.phylolm
Get fitted/predicted valuesgetFitted getFitted.default getFitted.gam getFitted.HLfit getFitted.MixMod getFitted.phyloglm getFitted.phylolm
Extract fixed effects of a supported modelgetFixedEffects getFixedEffects.default getFixedEffects.MixMod
Get model responsegetObservedResponse getObservedResponse.default getObservedResponse.HLfit getObservedResponse.phyloglm getObservedResponse.phylolm
Get Pearson residualsgetPearsonResiduals getPearsonResiduals.default getPearsonResiduals.gam
calculate quantilesgetQuantile
Record and restore a random stategetRandomState
Get model refitgetRefit getRefit.default getRefit.glmmTMB getRefit.HLfit getRefit.lm getRefit.MixMod
Get model residualsgetResiduals getResiduals.default getResiduals.MixMod
Get model simulationsgetSimulations getSimulations.default getSimulations.gam getSimulations.glmmTMB getSimulations.HLfit getSimulations.lmerMod getSimulations.MixMod getSimulations.negbin getSimulations.phyloglm getSimulations.phylolm
Histogram of DHARMa residualshist.DHARMa
Hurricaneshurricanes
Return outliersoutliers
DHARMa standard residual plotsplot.DHARMa
Plots DHARMa benchmarksplot.DHARMaBenchmark
Conventional residual plotplotConventionalResiduals
Quantile-quantile plot for a uniform distributionplotQQunif
Generic res ~ pred scatter plot with spline or quantile regression on topplotResiduals
DHARMa standard residual plotsplotSimulatedResiduals
Print simulated residualsprint.DHARMa
Recalculate residuals with groupingrecalculateResiduals
Return residuals of a DHARMa simulationresiduals.DHARMa
Benchmark calculationsrunBenchmarks
Simulated likelihood ratio tests for (generalized) linear mixed modelssimulateLRT
Create simulated residualssimulateResiduals
Test for categorical dependenciestestCategorical
DHARMa dispersion teststestDispersion
Test for a generic summary statistic based on simulated datatestGeneric
Test for outlierstestOutliers
Simulated overdisperstion teststestOverdispersion
Parametric overdisperstion teststestOverdispersionParametric
Plot distribution of p-values.testPDistribution
Test for phylogenetic autocorrelationtestPhylogeneticAutocorrelation
Test for quantilestestQuantiles
DHARMa general residual testtestResiduals
Residual teststestSimulatedResiduals
Test for distance-based (spatial, phylogenetic or similar) autocorrelationtestSpatialAutocorrelation
Test for temporal autocorrelationtestTemporalAutocorrelation
Test for overall uniformitytestUniformity
Tests for zero-inflationtestZeroInflation
Transform quantiles to pdf (deprecated)transformQuantiles