**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**

** +,xlab=”data_points(nm)”,ylab=”log(1/R)”)**
This is the spectra of the 28 samples without any treatment:

**> 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).

*Related*

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...

**Tags:** "R" Chemometrics