DHARMa0.4.7 package

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

getObservedResponse

Get model response

benchmarkRuntime

Benchmark runtimes of several functions

checkDots

Check dot operator

checkModel

Check if the fitted model is supported by DHARMa

checkSimulations

Check simulated data

testOverdispersion

Simulated overdisperstion tests

testOverdispersionParametric

Parametric overdisperstion tests

testPDistribution

Plot distribution of p-values.

testPhylogeneticAutocorrelation

Test for phylogenetic autocorrelation

createData

Simulate test data

createDHARMa

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

DHARMa-package

DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Re...

DHARMa.ecdf

Modified ECDF function.

ensureDHARMa

Ensures that an object is of class DHARMa

ensurePredictor

Ensures the existence of a valid predictor to plot residuals against

getFamily

Get model family

getFitted

Get fitted/predicted values

getFixedEffects

Extract fixed effects of a supported model

getPearsonResiduals

Get Pearson residuals

getPossibleModels

get possible models

getQuantile

Calculate Residual 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

Test for a generic summary statistic based on simulated data

testOutliers

Test for outliers

testQuantiles

Test for quantiles

testResiduals

DHARMa general residual test

testSimulatedResiduals

Residual tests

testSpatialAutocorrelation

Test for distance-based spatial (or similar type) autocorrelation

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'; 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.

  • Maintainer: Florian Hartig
  • License: GPL (>= 3)
  • Last published: 2024-10-18