Learn R Programming

sprm (version 1.2.2)

biplot.prm: Biplot for prm objects

Description

This biplot for prm objects visualizes the original variables which contribute to the model and their impact on the latent components as well as the position of the observations in the transformed space. The data is projected onto two of the latent components.

Usage

"biplot"(x, comps = c(1, 2), colors = list(scores = "#0000AA", loadings = "red", background = "#BBBBEE"), textsize = 6, arrowshapes = c(25, 0.03), labelpos=0.35, ...)

Arguments

x
object of class prm.
comps
vector with two integers, referring to the components to be plotted.
colors
list of three elements named scores, loadings and background with color codes or names of colors.
textsize
the text size in which to print the scores and loading names.
arrowshapes
vector of length two containing the angle of the arrowheads and their relative length in npc.
labelpos
numeric value; determines distance of the arrow label to the arrowhead.
...
further arguments. Currently not used.

References

Hoffmann, I., Serneels, S., Filzmoser, P., Croux, C. (2015). Sparse partial robust M regression. Chemometrics and Intelligent Laboratory Systems, 149, 50-59.

Serneels, S., Croux, C., Filzmoser, P., Van Espen, P.J. (2005). Partial Robust M-Regression. Chemometrics and Intelligent Laboratory Systems, 79, 55-64.

See Also

plot.prm, prms, biplot.sprm

Examples

Run this code
set.seed(5023)
U <- c(rep(3,20), rep(4,30))
X <- replicate(6, U+rnorm(50))
beta <- c(rep(1, 3), rep(-1,3))
e <- c(rnorm(45,0,1.5),rnorm(5,-20,1))
y <- X%*%beta + e
d <- as.data.frame(X)
d$y <- y
mod <- prms(y~., data=d, a=2, fun="Hampel")
biplot(mod, comps = c(1, 2))

Run the code above in your browser using DataLab