Description Usage Arguments Examples
Plot pls results for both calibration and validation groups on the same graph.
1 |
... |
pass on to plot |
mvr |
mvr object |
ncomp |
number of component |
location |
legend position |
show |
select statistics to show |
round |
digits to round |
newx |
newx |
newy |
newy |
fitline |
add fitline or not |
cex.stats |
text size of statistics legend |
cex.pt |
point size |
xlab |
x-axis label |
ylab |
y-axis label |
col.cal |
point color for calibration group |
col.val |
point color for validation group |
pch.cal |
pch for calibration group |
pch.val |
pch for validation group |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require(pls)
data(yarn)
yarn.cal <- yarn[yarn$train,]
yarn.val <- yarn[!yarn$train,]
model <- plsr(density ~ NIR, 15, data = yarn.cal, validation = "CV")
plot_ncomp(model)
ncomp <- 4 # 4 components seem to be appropriate
model <- plsr(density ~ NIR, ncomp, data = yarn.cal) # recalculate
plsplot(model) # calibration
plsplot(model, newx = yarn.val$NIR, newy = yarn.val$density) # validation
# now put those two plots together
plsplot2(model, newx = yarn.val$NIR, newy = yarn.val$density) # calibration and validation
plsplot2(model, newx = yarn.val$NIR, newy = yarn.val$density, col.cal = "forestgreen", col.val = "skyblue") # change point colors
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.