| plot.permutation | R Documentation |
Draws the permutation-test diagnostic plot produced by pls(..., perm.test = TRUE). The x-axis is the correlation between the original and
permuted response structure; the y-axis is the observed or permuted R2/Q2
value. R2 is shown in blue and Q2 in red.
## S3 method for class 'permutation'
plot(
x,
ncomp = NULL,
main = NULL,
xlab = "Cor",
ylab = "Value",
col = c(R2 = "#3155B7", Q2 = "#E5332A"),
pch = c(R2 = 16, Q2 = 15),
legend_position = "bottomright",
...
)
x |
A |
ncomp |
Component count to plot. Defaults to the largest component stored in the permutation table. |
main, xlab, ylab |
Plot title and axis labels. |
col, pch |
Colors and point symbols for R2 and Q2. |
legend_position |
Legend position passed to |
... |
Additional graphical parameters passed to |
Invisibly returns the plotted permutation data.
set.seed(1)
X <- as.matrix(iris[, seq_len(4)])
y <- iris$Sepal.Length
idx <- sample(seq_len(nrow(X)), 30)
fit <- pls(X[idx, ], y[idx], X[idx, ], y[idx],
ncomp = 2, perm.test = TRUE, times = 5
)
plot.permutation(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.