12 feb. 2012

"R" PLS Package: Multiple Scatter Correction (MSC)

MSC (Multiple Scatter Correction) is a Math treatment to correct the scatter in the spectra. The scatter is produced for different physical circumstances as particle size, packaging.
Normally scatter make worse the correlation of the spectra with the constituent of interest.
Almost all the chemometric software’s available include this math treatment and of course “R” have it as well in the “PLS Package”.
Following the Journal of Statistical Software (January 2007, Volume 18, Issue 2) there is a nice tutorial about how to use the PLS Package (Bjorn-Helge Mevik & Ron Wehrens).
The idea of this post is just compare graphically the spectra without any treatment and with the MSC treatment using the Near Infrared Data “yarn” from “R”.
> yarn
> wavelengths<-seq(1,268,by=1)
> matplot(wavelengths,t(yarn$NIR),lty=1,pch=21

This is the spectra of the 28 samples without any treatment:

> Ztrain<-msc(yarn$NIR)
> colnames(Ztrain)<-c(1:268)
> matplot(wavelengths,t(Ztrain),lty=1,pch=21,
+ xlab="data_points(nm)",ylab="log(1/R)")

This is the spectra of the 28 samples with MSC applied:

We can see the differences in the log(1/R) scale (Y axis).

1 comentario:

  1. Hi there
    I was wondering if you have the yarn database, could you allow me access to it?