halfnorm: Half normal plot with simulated envelopes

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/halfnorm.R

Description

halfnorm produces a half normal plot of the residuals with simulated envelopes useful for model evaluation and detection of outliers

Usage

1
2
3
4
halfnorm(object, resType = c("approx.deletion", "exact.deletion",
         "standard.deviance", "standard.pearson", "deviance",
         "pearson", "working", "response", "partial"), env = T,
         nsim = 20, plot = T, identify = F, n = 2)   

Arguments

object

An object of class glm with a binomial family

resType

The type of residual used in the plot

env

Logical for whether envelopes are simulated

nsim

Number of simulations used for the envelopes

plot

Logical for whether the points should be plotted. If plot = F a list is returned

identify

Logical for whether it should be possible to identify points interactively. Ignored if plot = F

n

How many points should be identified. Ignored if identify = F

Details

Absolute values of the residuals are used in a half normal plot that otherwise corresponds to a regular normal probability plot.

Residuals from a binomial glm are not necessarily uncorrelated and normally distributed and may accordingly deviate from a straight line even if the fitted model is true. If the fitted model is true the optional simulated envelopes are likely to contain the absolute residuals.

The different types of residuals are described in Residuals

Value

If plot = T a plot is produced. Otherwise a list of the residuals and their expected values are returned

Author(s)

Merete K Hansen

References

Atkinson, A. C. (1981) Two graphical displays for outlying and influential observations in regression. Biometrika, 68, 13-20.

Collett, D. (2003) Modelling binary data. Second edition. Chapman & Hall/CRC.

See Also

Residuals, identify

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Halfnormal plot with simulated envelopes
data(beetles)
beetles.glm <- glm(cbind(y, n-y) ~ conc, family=binomial, data=beetles)
halfnorm(beetles.glm, resType='pearson')

## Not run: 
## Halfnormal plot with simulated envelopes
## Two points are interactively identified when they are selected with the mouse
halfnorm(beetles.glm, resType='deviance', identify = T, n = 2)

## End(Not run)

binomTools documentation built on May 29, 2017, 10:12 p.m.