plot.regional_mix: Plot residuals from a regional_mix model.

plot.regional_mixR Documentation

Plot residuals from a regional_mix model.

Description

Plot residuals from a regional_mix model.

Usage

## S3 method for class 'regional_mix'
plot(
  x,
  ...,
  type = "RQR",
  nsim = 100,
  alpha.conf = c(0.9, 0.95, 0.99),
  quiet = FALSE,
  species = "AllSpecies",
  fitted.scale = "response"
)

Arguments

x

a fitted regional_mix model you wish to plot

type

What type of residuals to plot? 'RQR'; random quantile residuals or 'deviance' residuals.

nsim

Number of simulations to run

alpha.conf

The bounds of the confidence intervals.

quiet

Run in quiet mode.

species

Which species to plot as residuals.

fitted.scale

What scale to plot the residuals on?

\dots

Additional plotting calls

Details

The two types of residuals are inherently different. The "RQR" residuals produce a residual for each species at each site and the "deviance" residuals produce a site residual (no species level residual). The plots also differ, the "RQR" type generates a single normal QQ-plot for all species and all sites, and a residual versus fitted plot for all species and sites (Described in Foster et al, 2013). The "deviance" type generates a pair of Tukey mean-difference plots, similar in spirit to a QQ-plot. The first is for point-wise confidence intervals and the second is for approximate global intervals. See Foster et al (2013) for details. The family for the "RQR" residuals should be standard normal. For "deviance" residuals, the distribution is unknown and simulation is used to graphically assess how odd the observed residuals look compared to ones generated assuming the model is correct.

References

Dunn, P.K. and Smyth G.K. (1996) Randomized Quantile Residuals. Journal of Computational and Graphical Statistics 5: 236–244. Foster, S.D., Givens, G.H., Dornan, G.J., Dunstan, P.K. and Darnell, R. (2013) Modelling Regions of Common Profiles Using Biological and Environmental Data. Environmetrics 24: 489–499. DOI: 10.1002/env.2245 Foster, S.D., Hill, N.A. and Lyons, M., 2017. Ecological grouping of survey sites when sampling artefacts are present. Journal of the Royal Statistical Society: Series C (Applied Statistics), 66(5), pp.1031-1047.


skiptoniam/ecomix documentation built on Sept. 14, 2023, 6:04 a.m.