| hist.DHARMa | R Documentation |
The function produces a histogram from a DHARMa output. Outliers are marked in red.
## S3 method for class 'DHARMa'
hist(x, breaks = seq(-0.02, 1.02, len = 53),
col = c(.Options$DHARMaSignalColor, rep("lightgrey", 50),
.Options$DHARMaSignalColor), main = "Hist of DHARMa residuals",
xlab = "Residuals (outliers are marked red)", cex.main = 1, ...)
x |
a DHARMa simulation output (class DHARMa). |
breaks |
breaks for hist() function. |
col |
color for histogram bars. |
main |
plot title. |
xlab |
plot x-axis label. |
cex.main |
plot cex.main. |
... |
other arguments to be passed on to hist(). |
The function calls hist() to create a histogram of the scaled residuals. Outliers are marked red as default but it can be changed by setting options(DHARMaSignalColor = "red") to a different color. See getOption("DHARMaSignalColor") for the current setting.
plot.DHARMa, plotResiduals
testData = createData(sampleSize = 200, family = poisson(),
fixedEffects = c(1,1),
randomEffectVariance = 1, numGroups = 10)
testData$Environment2[1] = NA
fittedModel <- glm(observedResponse ~ Environment1 + Environment2,
family = "poisson", data = testData)
simulationOutput <- simulateResiduals(fittedModel = fittedModel)
######### main plotting function #############
plot(simulationOutput)
# for all functions, quantreg = T (default) will be more informative
# but slower. Alternative:
plot(simulationOutput, quantreg = FALSE)
############# Distribution ######################
plotQQunif(simulationOutput = simulationOutput,
testDispersion = FALSE,
testUniformity = FALSE,
testOutliers = FALSE)
hist(simulationOutput)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.