"R": PLS Regression (Gasoline) – 005

February 8, 2012

(This article was first published on NIR-Quimiometría, and kindly contributed to R-bloggers)

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)
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
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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...


Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)