p.res.2x {sfsmisc} | R Documentation |
Plot Residuals (e.g., of a multiple linear regression) against two
(predictor) variables. This is now a (S3) generic function
with a default
and a formula
method.
p.res.2x(x, ...) ## Default S3 method: p.res.2x(x, y, z, restricted, size = 1, slwd = 1, scol = 2:3, xlab = NULL, ylab = NULL, main = NULL, xlim = range(x), ylim = range(y), ...) ## S3 method for class 'formula' p.res.2x(x = ~., data, main = deparse(substitute(data)), xlab = NULL, ylab = NULL, ...)
x, y |
numeric vectors of the same length specifying 2
covariates. For the |
z |
numeric vector of same length as |
restricted |
positive value which truncates the size. The corresponding symbols are marked by stars. |
size |
the symbols are scaled so that |
slwd, scol |
line width and color(s) for the residual
|
xlab, ylab, main |
axis labels, and title see |
xlim, ylim |
the basic x- and y- axis extents, see
|
... |
further arguments passed to |
data |
(for the |
The formula interface will call p.res.2fact()
when
both x
and y
are factor
s.
........... ..........
Andreas Ruckstuhl in June 1991 and Martin Maechler, in 1992, '94, 2003-4.
Stahel, W. (1996) ........
p.res.2fact
,
plot.lm
,
TA.plot
.
xx <- rep(1:10,7) yy <- rep(1:7, rep(10,7)) zz <- rnorm(70) p.res.2x(xx,yy,zz, restr = 2, main = "i.i.d. N(0,1) random residuals") example(lm.influence, echo = FALSE) op <- mult.fig(2, marP=c(-1,-1,-1,0), main="p.res.2x(*,*, residuals(lm.SR))")$old.par with(LifeCycleSavings, { p.res.2x(pop15, ddpi, residuals(lm.SR), scol=c("red", "blue")) p.res.2x(pop75, dpi, residuals(lm.SR), scol=2:1) }) ## with formula interface: p.res.2x(~ pop15 + ddpi, lm.SR, scol=c("red", "blue")) p.res.2x(~ pop75 + dpi, lm.SR, scol=2:1) par(op) # revert par() settings above