DHARMa0.4.6 package

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

benchmarkRuntime

Benchmark runtimes of several functions

checkDots

Check dot operator

checkModel

Check if the fitted model is supported by DHARMa

checkSimulations

Check simulated data

createData

Simulate test data

createDHARMa

Create a DHARMa object from hand-coded simulations or Bayesian posteri...

DHARMa.ecdf

Modified ECDF function

DHARMa

DHARMa - Residual Diagnostics for HierArchical (Multi-level / Mixed) R...

ensureDHARMa

Ensures that an object is of class DHARMa

ensurePredictor

Ensures the existence of a valid predictor to plot residuals against

getFitted

Get fitted / predicted values

getFixedEffects

Extract fixed effects of a supported model

getObservedResponse

Get model response

getPossibleModels

get possible models

getQuantile

calculate quantiles

getRandomState

Record and restore a random state

getRefit

Get model refit

getResiduals

Get model residuals

getSimulations

Get model simulations

hist.DHARMa

Histogram of DHARMa residuals

outliers

Return outliers

plot.DHARMa

DHARMa standard residual plots

plot.DHARMaBenchmark

Plots DHARMa benchmarks

plotConventionalResiduals

Conventional residual plot

plotQQunif

Quantile-quantile plot for a uniform distribution

plotResiduals

Generic res ~ pred scatter plot with spline or quantile regression on ...

plotSimulatedResiduals

DHARMa standard residual plots

print.DHARMa

Print simulated residuals

recalculateResiduals

Recalculate residuals with grouping

residuals.DHARMa

Return residuals of a DHARMa simulation

runBenchmarks

Benchmark calculations

simulateLRT

Simulated likelihood ratio tests for (generalized) linear mixed models

simulateResiduals

Create simulated residuals

testCategorical

Test for categorical dependencies

testDispersion

DHARMa dispersion tests

testGeneric

Generic simulation test of a summary statistic

testOutliers

Test for outliers

testOverdispersion

Simulated overdisperstion tests

testOverdispersionParametric

Parametric overdisperstion tests

testPDistribution

Plot distribution of p-values

testQuantiles

Test for quantiles

testResiduals

DHARMa general residual test

testSimulatedResiduals

Residual tests

testSpatialAutocorrelation

Test for distance-based (spatial, phylogenetic or similar) autocorrela...

testTemporalAutocorrelation

Test for temporal autocorrelation

testUniformity

Test for overall uniformity

testZeroInflation

Tests for zero-inflation

transformQuantiles

Transform quantiles to pdf (deprecated)

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.

  • Maintainer: Florian Hartig
  • License: GPL (>= 3)
  • Last published: 2022-09-08