NIT: Fatty acids study in R – Part 005

March 9, 2012

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

There are several algorithms to run a PLS regression (I recommend to consult the books: “Introduction to Multivariate Analysis in Chemometrics – Kurt Varmuza & Peter Filzmozer” and “Chemometrics with R – Ron Wehrens”).
We are going to use the PLS package, and we are going to develop, maybe the constituent which looks more promising: Oleic Acic (C18:1).
Of course we are going to use the MSC pretreatment. For vcross validation we are going to use “leave one out”.I decide a maximum of 16 PLS terms.
> C18_1<- plsr(C18_1~NITmsc, ncomp = 16,data =fattyac_msc, 
  + validation = “LOO”)

Allways is good to look to the plots:

>  plot(C18_1,ncomp=12,which=”validation”)
We can see how from Term 12 the RMSEP increase.
We can see in the XY plot, how we have a few samples with a high residual (probably wrong lab value for one or two of them). We can delete these samples from the data set to develop the equation again (RMSEP will decrease a little bit and the RSQ will increase)
We have to consider the Lab error for this parameter of the reference method: Chromatography.
The extreme sample 66, fits well in the model, so we decide to keep it. The model seems quite good to predict “Oleic acid”.  We will test it in a near future with new samples (independent test set).

To leave a comment for the author, please follow the link and comment on their blog: NIR-Quimiometría. 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.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

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)