[R] PLS in R
Margarida Soares
margaridapmsoares at gmail.com
Tue Dec 5 11:30:06 CET 2017
Hello, I need help with a partial least square regression in R. I have read
both the vignette and the post on R bloggers but it is hard to figure out
how to do it. Here is the script I wrote:
library(pls)
plsrcue<- plsr(cue~fb+cn+n+ph+fung+bact+resp, data = cue, ncomp=7,
na.action = NULL, method = "kernelpls", scale=FALSE, validation = "LOO",
model = TRUE, x = FALSE, y = FALSE)
summary(plsrcue)
and I got this output, where I think I can choose the number of components
based on RMSEP, but how do I choose it?
Data: X dimension: 33 7
Y dimension: 33 1
Fit method: kernelpls
Number of components considered: 7
VALIDATION: RMSEP
Cross-validated using 33 leave-one-out segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps 7
comps
CV 0.09854 0.07014 0.05366 0.04712 0.01935 0.01943 0.01882
0.01900
adjCV 0.09854 0.06999 0.05357 0.04703 0.01930 0.01942 0.01876
0.01893
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps 7 comps
X 42.33 78.82 99.15 99.95 100.00 100.00 100.00
cue 56.77 76.14 81.98 97.05 97.11 97.56 97.75
- and also, how to proceed from here?
- and how to make a correlation plot?
- what to do with the values, coefficients that I get in the Environment
(pls values)
Thanks for your help!
margarida soares
[[alternative HTML version deleted]]
More information about the R-help
mailing list