avPlots(model, terms=~., intercept=FALSE, layout=NULL, ask, main, ...)
avp(...)
avPlot(model, ...)
## S3 method for class 'lm':
avPlot(model, variable,
id.method = list(abs(residuals(model, type="pearson")), "x"),
labels,
id.n = if(id.method[1]=="identify") Inf else 0,
id.cex=1, id.col=palette()[1],
col = palette()[1], col.lines = palette()[2],
xlab, ylab, pch = 1, lwd = 2,
main=paste("Added-Variable Plot:", variable),
grid=TRUE,
ellipse=FALSE, ellipse.args=NULL,
marginal.scale=FALSE, ...)
## S3 method for class 'glm':
avPlot(model, variable,
id.method = list(abs(residuals(model, type="pearson")), "x"),
labels,
id.n = if(id.method[1]=="identify") Inf else 0,
id.cex=1, id.col=palette()[1],
col = palette()[1], col.lines = palette()[2],
xlab, ylab, pch = 1, lwd = 2, type=c("Wang", "Weisberg"),
main=paste("Added-Variable Plot:", variable), grid=TRUE,
ellipse=FALSE, ellipse.args=NULL, ...)
lm
or glm
.terms = ~.-X3
would plot against all terms
except for X3
. If this argument is a qFALSE
.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 laTRUE
, ask the user before drawing the next plot; if FALSE
don't ask.avPlots
passes these arguments to avPlot
.
avPlot
passes them to plot
.id.n=0
for labeling no points. See
showLabels
for details of these arguments.1
(a circle, see par
).2
(see par
)."Wang"
use the method of Wang (1985);
if "Weisberg"
use the method in the Arc software associated with
Cook and Weisberg (1999).TRUE
, the default, a light-gray background grid is put on the graph.TRUE
, plot a concentration ellipse; default is FALSE
.link{dataEllipse}
function, in the form of a list
with named elements; e.g., ellipse.args=list(robust=TRUE))
will cause the ellipse to be plotted using
a robust covariance-matrix.FALSE
then the limits on the horizontal axis are determined by the range of the residuals from the regression of X on Z and the limits on the vertical axis are determavPlots
(for which avp
is an abbreviation).residualPlots
, crPlots
, ceresPlots
, link{dataEllipse}
avPlots(lm(prestige~income+education+type, data=Duncan))
avPlots(glm(partic != "not.work" ~ hincome + children,
data=Womenlf, family=binomial))
m1 <- lm(partic ~ tfr + menwage + womwage + debt + parttime, Bfox)
par(mfrow=c(1,3))
plot(partic ~ womwage, Bfox) # marginal plot, ignoring other predictors
abline(lm(partic ~ womwage, Bfox), col="red", lwd=2)
grid()
avPlots(m1, ~ womwage) # av Plot, adjusting for others
avPlots(m1, ~ womwage, marginal.scale=TRUE) # av Plot, adjusting and scaling as in marginal plot
Run the code above in your browser using DataLab