Description Usage Arguments Details Author(s) References See Also Examples
Four types of plot options are available:
y vs y predicted plot, plot of case weights used for robust weighted regression, plot of estimated coefficients, distance-distance plot.
1 2 3 4 5 |
x |
object of class sprm. |
type |
choices are |
alpha |
significance level. Default is 0.025. Will be ignored if |
colors |
list with six elements with color codes or names for |
textsize |
the text size in which to print the scores and loading names. Will be ignored if type is |
errorbar_width |
a numeric containing the width of the error bars for |
data |
optional data frame, containing new cases to predict and plot for |
yscale |
optional scale vector for the yscale in the y vs y predicted plot (e.g. if two different regression plots have to be on the same scale) |
... |
further arguments. Currently not used. |
The choices for type
are:
type="yyp"
- y vs y predicted plot with confidence intervals for each observation.
type="weights"
- plot of case weights used for robust weighted regression.
type="coefficients"
- plot of the value of each coefficient estimate with confidence interval.
type="dd"
- distance-distance plot for for visualization of leverage points. Robust distances are plotted against Mahalanobis distances.
Sven Serneels, BASF Corp.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | set.seed(5023)
U1 <- c(rep(2,20), rep(5,30))
U2 <- rep(3.5,50)
X1 <- replicate(5, U1+rnorm(50))
X2 <- replicate(20, U2+rnorm(50))
X <- cbind(X1,X2)
beta <- c(rep(1, 5), rep(0,20))
e <- c(rnorm(45,0,1.5),rnorm(5,-20,1))
y <- X%*%beta + e
d <- as.data.frame(X)
d$y <- y
smod <- sprms(y~., data=d, a=1, eta=0.5, fun="Hampel")
mod <- prms(y~., data=d, a=1, fun="Hampel")
plot(smod, type="yyp", errorbar_width=0.001)
plot(smod, type="coefficients")
plot(mod, type="coefficients")
plot(smod, type="weights")
plot(smod, type="dd", colors=list(background="lightgray", scores="darkblue", cutoffs="red"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.