Learn R Programming

⚠️There's a newer version (0.4.7) of this package.Take me there.

DHARMa - Residual Diagnostics for HierARchical Models

The DHARMa package creates readily interpretable residuals for generalized linear (mixed) models that are standardized to values between 0 and 1. This is achieved by a simulation-based approach, similar to the Bayesian p-value or the parametric bootstrap: 1) simulate new data from the fitted model 2) from this simulated data, calculate the cummulative density function 3) residual is the value of the empirical density function at the value of the observed data.

The package includes various functions that deal with issues such as

  • Misfit
  • Overdispersion
  • Zero-inflation
  • Residual temporal autocorrelation
  • Residual spatial autocorrelation

To get more information, install the package and run

library(DHARMa)
?DHARMa
vignette("DHARMa", package="DHARMa")

Copy Link

Version

Install

install.packages('DHARMa')

Monthly Downloads

17,027

Version

0.1.3

License

GPL (>= 3)

Maintainer

Florian Hartig

Last Published

December 12th, 2016

Functions in DHARMa (0.1.3)

testSimulatedResiduals

Residual tests
if predictor is a factor, a boxplot will be plotted instead of a scatter plot.

Generic residual plot with either spline or quantile regression
fitted.gam

This function overwrites the standard fitted function for GAM
testTemporalAutocorrelation

Test for temporal autocorrelation
testOverdispersionParametric

Parametric overdipersion test
benchmarkOverdispersion

Overdispersion benchmarks
testSpatialAutocorrelation

Test for spatial autocorrelation
benchmarkP

General Type I/II benchmarks
createDHARMa

Convert simulated residuals to a DHARMa object
DHARMa

DHARMa - Residual Diagnostics for HierArchical (Multi-level / Mixed) Regression Models
testZeroInflation

Tests for zero-inflation
testUniformity

Test for overall uniformity
print.DHARMa

Print simulated residuals
plotSimulatedResiduals

DHARMa standard residual plots
plotConventionalResiduals

Conventional residual plot
plot.DHARMa

Plot simulated residuals
testOverdispersion

Test for over/underdispersion
simulateResiduals

Create simulated residuals
createData

Simulate test data
benchmarkUniformity

Uniformity benchmarks