"R": PLS Regression (Gasoline) – 005
[This article was first published on NIR-Quimiometría, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Let´s see know how to plot the scores for the 3 PLS Components:
We can see the explained variance from each component in the diagonal.
We can get it from R with:
> explvar(gas1) Comp 1 Comp 2 Comp 3 Comp 4 Comp 5 Comp 6
70.9656438 7.5943956 7.5871843 9.2537926 0.7201960 0.8472951
Comp 7 Comp 8 Comp 9 Comp 10
0.3538649 0.7810986 0.2184760 0.3878373
We can change “scores” for “ loadings”, and get the plot of the 3 loadings together:
or one by one:
We can plot also the regression coefficients spectrum, or to see the values in numbers:
> coef(gas1,comp=3)
octane
900 nm 0.1491498386
902 nm 0.1468577061
904 nm 0.1463829295
906 nm 0.1478201762
908 nm 0.1511718253
910 nm 0.1521591068
912 nm 0.1756188138
914 nm 0.1561727797
916 nm 0.1580512737
918 nm 0.1342321544
920 nm 0.1140515422
922 nm 0.1154623941
…………………
…………………
Bibliography:
Tutorials PLS Package for “R” :
Bjorn-Helge Mevik
Norwegian University of Life Sciences
Ron Wehrens
Radboud University Nijmegen
To leave a comment for the author, please follow the link and comment on their blog: NIR-Quimiometría.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.