data(NIR)
## Default methods:
NIR.pcr <- pcr(y ~ X, 6, data = NIR, CV = TRUE)
NIR.pls <- plsr(y ~ X, 6, data = NIR, CV = TRUE)
## Alternative methods:
NIR.oscorespls <- mvr(y ~ X, 6, data = NIR, CV = TRUE,
method = "oscorespls")
NIR.simpls <- mvr(y ~ X, 6, data = NIR, CV = TRUE,
method = "simpls")
data(sensory)
Pn <- scale(sensory$Panel)
Ql <- scale(sensory$Quality)
sens.pcr <- pcr(Ql ~ Pn, ncomp = 4)
sens.pls <- plsr(Ql ~ Pn, ncomp = 4)
Run the code above in your browser using DataLab