Learn R Programming

DHARMa (version 0.1.3)

benchmarkUniformity: Uniformity benchmarks

Description

This function runs simulation to confirm uniformity of residuals under H0

Usage

benchmarkUniformity(dataModelCreator, nSim = 100, plot = T, ...)

Arguments

dataModelCreator
a function that returns a list with two elements, data and model. See help for details
nSim
number of simulations
plot
should a plot be created
...
parameters to pass on to simulateResiduals

Details

This function runs repeated simulations to test of residuals are really uniform if the data-creating process and the model that is used to fit the data are identical

See Also

benchmarkOverdispersion

Examples

Run this code
library(lme4)

dataModelCreator <- function(){
  data = createData(sampleSize = 100, overdispersion = 0, family = poisson())
  model <- glmer(observedResponse ~ Environment1 + (1|group) + 
    (1|ID), data = data, family = "poisson")  
  return(list(data=data, model = model))
}

## Not run: benchmarkUniformity(dataModelCreator = dataModelCreator, nSim = 4)

Run the code above in your browser using DataLab