avplot {glmxdiag}R Documentation

Added Variable Plot

Description

Constructs added variable plots for generalized linear models and extensions admitted by glmxdiag.

Usage

avplot(model, variables, type = c("Wang", "Hines-Carter"), label.id,
              n.label.id, xlab, ylab, main, pos, pch, cex, lcol, lwd, lty, ...)

Arguments

model

a model supported by glmxdiag.

variables

a vector of characters containing names of regressors; must be included inside the model matrix. If nothing is specified, avplot is applied on all variables.

type

default is "Wang" developed by Wang (1985); if "Hines-Carter" the method developed by Hines and Carter (1993) is used.

label.id

labels of observations, should be a vector with n elements

n.label.id

number of observations to label in the plot that most influence the "clean" relationship of considered variables. Cook's distance is used as the measure of influence.

xlab

title for the x axis.

ylab

title for the y axis.

main

an overall title for the plot.

pos

position of observations labels. Values 1, 2, 3, 4 respectively indicate below, left, above, right.

pch

type of points.

cex

size of points.

lcol

color of line.

lwd

width of line.

lty

type of line.

...

further arguments passed to plot.

Details

The aim of added variable plot is to isolate the relationship between a specific variable and the response, i.e. fixing all the other variables included in the linear predictor. In the y-axis there are the working residuals of the reduced model (i.e. a model where the variable we're interested in, say "x", is excluded) while on the x-axis there are the residuals of regression of x using all the other variables. Values in both axis are weighted: Wang (1985) uses the working weights of the reduced model while Hines and Carter (1993) suggest that using the weights of the full model is more reliable in indicating the presence of influential observations.

Value

Doesn't return a value, called for side effects.

Author(s)

Giuseppe Reale

References

Wang, P C. (1985) Adding a variable in generalized linear models. Technometrics 27, 273-276.

R. J. O'Hara Hines, & Carter, E. M. (1993). Improved Added Variable and Partial Residual Plots for the Detection of Influential Observations in Generalized Linear Models. Journal of the Royal Statistical Society. Series C (Applied Statistics), 42(1), 3-20.

Examples

data(moons)
m <- glm(Moons ~ Mass + Distance + Diameter, 
         family = poisson, data = moons)
summary(m)
avplot(m, 'Distance', label.id = moons$Name)


[Package glmxdiag version 1.0.0 Index]