# NOT RUN {
data(yarn)
yarn.pls <- plsr(density ~ NIR, data = yarn, scale = TRUE,
ncomp = 20, validation = "LOO")
selectNcomp(yarn.pls, "onesigma", plot = TRUE, ylim = c(0, 3))
selectNcomp(yarn.pls, "randomization", plot = TRUE)
selectNcomp(yarn.pls, "randomization", plot = TRUE,
ncomp = 10, ylim = c(0, 3))
# }
Run the code above in your browser using DataLab