Learn R Programming

car (version 3.0-2)

dfbetaPlots: dfbeta and dfbetas Index Plots

Description

These functions display index plots of dfbeta (effect on coefficients of deleting each observation in turn) and dfbetas (effect on coefficients of deleting each observation in turn, standardized by a deleted estimate of the coefficient standard error). In the plot of dfbeta, horizontal lines are drawn at 0 and +/- one standard error; in the plot of dfbetas, horizontal lines are drawn and 0 and +/- 1.

Usage

dfbetaPlots(model, ...)

dfbetasPlots(model, ...)

# S3 method for lm dfbetaPlots(model, terms= ~ ., intercept=FALSE, layout=NULL, ask, main, xlab, ylab, labels=rownames(dfbeta), id.method="y", id.n=if(id.method[1]=="identify") Inf else 0, id.cex=1, id.col=carPalette()[1], id.location="lr", col=carPalette()[1], grid=TRUE, ...)

# S3 method for lm dfbetasPlots(model, terms=~., intercept=FALSE, layout=NULL, ask, main, xlab, ylab, labels=rownames(dfbeta), id.method="y", id.n=if(id.method[1]=="identify") Inf else 0, id.cex=1, id.col=carPalette()[1], id.location="lr", col=carPalette()[1], grid=TRUE, ...)

Arguments

model

model object produced by lm or glm.

terms

A one-sided formula that specifies a subset of the terms in the model. One dfbeta or dfbetas plot is drawn for each regressor. The default ~. is to plot against all terms in the model with the exception of an intercept. For example, the specification terms = ~.-X3 would plot against all terms except for X3. If this argument is a quoted name of one of the terms, the index plot is drawn for that term only.

intercept

Include the intercept in the plots; default is FALSE.

layout

If set to a value like c(1, 1) or c(4, 3), the layout of the graph will have this many rows and columns. If not set, the program will select an appropriate layout. If the number of graphs exceed nine, you must select the layout yourself, or you will get a maximum of nine per page. If layout=NA, the function does not set the layout and the user can use the par function to control the layout, for example to have plots from two models in the same graphics window.

main

The title of the graph; if missing, one will be supplied.

xlab

Horizontal axis label; defaults to "Index".

ylab

Vertical axis label; defaults to coefficient name.

ask

If TRUE, ask the user before drawing the next plot; if FALSE, the default, don't ask.

optional additional arguments to be passed to plot, points, and showLabels

id.method, labels, id.n, id.cex, id.col, id.location

Arguments for the labelling of points. The default is id.n=0 for labeling no points. See showLabels for details of these arguments.

col

color for points; defaults to the first entry in the color carPalette.

grid

If TRUE, the default, a light-gray background grid is put on the graph

Value

NULL. These functions are used for their side effect: producing plots.

References

Fox, J. (2016) Applied Regression Analysis and Generalized Linear Models, Third Edition. Sage.

Fox, J. and Weisberg, S. (2019) An R Companion to Applied Regression, Third Edition, Sage.

See Also

dfbeta ,dfbetas

Examples

Run this code
# NOT RUN {
dfbetaPlots(lm(prestige ~ income + education + type, data=Duncan))

dfbetasPlots(glm(partic != "not.work" ~ hincome + children, 
  data=Womenlf, family=binomial))
# }

Run the code above in your browser using DataLab