Learn R Programming

genridge (version 0.6-3)

pairs.ridge: Scatterplot Matrix of Bivariate Ridge Trace Plots

Description

Displays all possible pairs of bivariate ridge trace plots for a given set of predictors.

Usage

## S3 method for class 'ridge':
pairs(x, variables, radius = 1, lwd = 1, lty = 1, 
   col = c("black", "red", "darkgreen", "blue", "darkcyan", "magenta", "brown", "darkgray"), 
   center.pch = 16, center.cex = 1.25, digits = getOption("digits") - 3, 
   diag.cex = 2, diag.panel = panel.label, fill = FALSE, fill.alpha = 0.3, ...)

Arguments

Value

None. Used for its side effect of plotting.

References

Friendly, M. (2012). The Generalized Ridge Trace Plot: Visualizing Bias and Precision. In press, Journal of Computational and Graphical Statistics, 21.

See Also

ridge for details on ridge regression as implemented here plot.ridge, traceplot for other plotting methods

Examples

Run this code
longley.y <- longley[, "Employed"]
longley.X <- data.matrix(longley[, c(2:6,1)])

lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08)
lridge <- ridge(longley.y, longley.X, lambda=lambda)

pairs(lridge, radius=0.5, diag.cex=1.75)

if (require("ElemStatLearn")) {
	py <- prostate[, "lpsa"]
	pX <- data.matrix(prostate[, 1:8])
	pridge <- ridge(py, pX, df=8:1)
	
	pairs(pridge)
}

Run the code above in your browser using DataLab