Learn R Programming

sfsmisc (version 0.9-4)

p.res.2x: Stahel's Residual Plot against 2 X's

Description

Plot Residuals (e.g., of a multiple linear regression)

Usage

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), ...)

Arguments

x,y
numeric vectors of the same length specifying 2 covariates.
z
numeric vector of same length as x and y, typically residuals.
restricted
positive value which truncates the size. The corresponding symbols are marked by stars.
size
the symbols are scaled so that size is the size of the largest symbol in cm.
slwd, scol
line width and color(s) for the residual segments. If scol has length 2 as per default, the two colors are used for positive and negative z values, respectively.
xlab, ylab, main
axis labels, and title see title, each with a sensible default. To suppress, use, e.g., main = "".
xlim, ylim
the basic x- and y- axis extents, see plot.default. Note that these will be slightly extended such that segments are not cut off.
...
further arguments passed to plot.

Details

........... ..........

References

Stahel, W. (1996) ........

See Also

p.res.2fact, plot.lm, TA.plot.

Examples

Run this code
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")
p.res.2x(xx,yy,zz, restr = 2, main = "p.res.2x(*, xlim, ylim)",
          xlim = c(2,8), ylim = c(1,4))
example(lm.influence, echo = FALSE)
mult.fig(2, marP=c(0,-1,-2,0), main="p.res.2x(*,*, residuals(lm.SR))")
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)
     })

Run the code above in your browser using DataLab