Learn R Programming

sprm (version 1.1)

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

## S3 method for class 'prm':
biplot(x, comps = c(1, 2), 
colors = list(scores = "#0000AA", loadings = "red", background = "#BBBBEE"), 
textsize = 6, arrowshapes = c(25, 0.03), ...)

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.
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.
...
further arguments. Currently not used.

References

Sven Serneels et al. (2014) Sparse partial robust M regression

Serneels, S., Croux, C., Filzmoser, P., Van Espen, P.J., Partial Robust M-Regression. Chemometrics and Intelligent Laboratory Systems, 79 (2005), 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