Package: DHARMa 0.4.7

Florian Hartig

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'; 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, phylogenetic and temporal autocorrelation.

Authors:Florian Hartig [aut, cre], Lukas Lohse [ctb], Melina de Souza leite [ctb]

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

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

Peer review:

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

Datasets:

On CRAN:

glmmregressionregression-diagnosticsresidual

14.44 score 210 stars 9 packages 2.6k scripts 11k downloads 194 mentions 37 exports 94 dependencies

Last updated 17 hours agofrom:53172bb52d. Checks:OK: 7. Indexed: no.

TargetResultDate
Doc / VignettesOKOct 22 2024
R-4.5-winOKOct 22 2024
R-4.5-linuxOKOct 22 2024
R-4.4-winOKOct 22 2024
R-4.4-macOKOct 22 2024
R-4.3-winOKOct 22 2024
R-4.3-macOKOct 22 2024

Exports:benchmarkRuntimecreateDatacreateDHARMagetFamilygetFittedgetFixedEffectsgetObservedResponsegetPearsonResidualsgetQuantilegetRandomStategetRefitgetResidualsgetSimulationsoutliersplotConventionalResidualsplotQQunifplotResidualsplotSimulatedResidualsrecalculateResidualsrunBenchmarkssimulateLRTsimulateResidualstestCategoricaltestDispersiontestGenerictestOutlierstestOverdispersiontestOverdispersionParametrictestPhylogeneticAutocorrelationtestQuantilestestResidualstestSimulatedResidualstestSpatialAutocorrelationtestTemporalAutocorrelationtestUniformitytestZeroInflationtransformQuantiles

Dependencies:apeaskpassbase64encbootbslibcachemclicodetoolscolorspacecommonmarkcpp11crayoncrosstalkcurldata.tabledigestdoParalleldplyrevaluatefansifarverfastmapfontawesomeforeachfsgapgap.datasetsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttpuvhttrisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclelme4lmtestmagrittrMASSMatrixmemoisemgcvmimeminqamunsellnlmenloptropensslpillarpkgconfigplotlyplyrpromisespurrrqgamR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackrlangrmarkdownsassscalesshinysourcetoolsstringistringrsystibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunxtableyamlzoo

DHARMa for Bayesians

Rendered fromDHARMaForBayesians.Rmdusingknitr::rmarkdownon Oct 22 2024.

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

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

Rendered fromDHARMa.Rmdusingknitr::rmarkdownon Oct 22 2024.

Last update: 2024-10-22
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 Residual QuantilesgetQuantile
Record and restore a random stategetRandomState
Get model refitgetRefit getRefit.default getRefit.glmmTMB getRefit.HLfit getRefit.lm getRefit.MixMod getRefit.phyloglm getRefit.phylolm
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 (or similar type) autocorrelationtestSpatialAutocorrelation
Test for temporal autocorrelationtestTemporalAutocorrelation
Test for overall uniformitytestUniformity
Tests for zero-inflationtestZeroInflation
Transform quantiles to pdf (deprecated)transformQuantiles