Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/biplot.pcaridge.R
biplot.pcaridge
supplements the standard display of the
covariance ellipsoids for a ridge regression problem in PCA/SVD
space with labeled arrows showing the contributions of the
original variables to the dimensions plotted.
The biplot view showing the dimensions corresponding to the two smallest singular values is particularly useful for understanding how the predictors contribute to shrinkage in ridge regression.
This is only a biplot in the loose sense that results are shown in two spaces simultaneously – the transformed PCA/SVD space of the original predictors, and vectors representing the predictors projected into this space.
biplot.ridge
is a similar extension of plot.ridge
,
adding vectors showing the relation of the PCA/SVD dimensions to the
plotted variables.
1 2 3 4 5 6 7 8 |
x |
A |
variables |
The dimensions or variables to be shown in the the plot. By default, the
last two dimensions, corresponding to the smallest
singular values, are plotted for |
labels |
A vector of character strings or expressions used as labels for the ellipses.
Use |
asp |
Aspect ratio for the plot. The default value, |
origin |
The origin for the variable vectors in this plot, a vector of length 2. If not specified, the function calculates an origin to make the variable vectors approximately centered in the plot window. |
scale |
The scale factor for variable vectors in this plot. If not specified, the function calculates a scale factor to make the variable vectors approximately fill the plot window. |
var.lab |
Labels for variable vectors. The default is the names of the predictor variables. |
var.lwd, var.col, var.cex |
Line width, color and character size used to draw and label the arrows representing the variables in this plot. |
xlab, ylab |
Labels for the plot dimensions. If not specified, |
prefix |
Prefix for labels of the plot dimensions. |
suffix |
Suffix for labels of the plot dimensions. If |
... |
Other arguments, passed to |
class("ridge")
objects use the transpose of the right singular vectors, t(x$svd.V)
for the dimension weights
plotted as vectors.
None
Michael Friendly, with contributions by Uwe Ligges
Friendly, M. (2012). The Generalized Ridge Trace Plot: Visualizing Bias and Precision. In press, Journal of Computational and Graphical Statistics, 21.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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)
plridge <- pca.ridge(lridge)
plot(plridge, radius=0.5)
# same, with variable vectors
biplot(plridge, radius=0.5)
# add some other options
biplot(plridge, radius=0.5, var.col="brown", var.lwd=2, var.cex=1.2, prefix="Dimension ")
# biplots for ridge objects, showing PCA vectors
plot(lridge, radius=0.5)
biplot(lridge, radius=0.5)
biplot(lridge, radius=0.5, asp=NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.