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 prm. |
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 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 | set.seed(5023)
U <- c(rep(2,20), rep(5,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")
plot.prm(mod, type="yyp", errorbar_width=0.001)
plot(mod, type="coefficients",
colors = list(bars = "darkgreen", errorbars = "red", background = "lightgray"))
plot(mod, type="weights")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.