"R" Chemometrics

NIR "Cross Validaton Statistics" with "R"

February 16, 2012 | jrcuesta

We have to check different options before to decide for one model:Configure different cross validations.Configure different math  treatments.Configure number of terms.With the Yarn NIR data, I have develop 4 models, for a simple exercise.Of course...
[Read more...]

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

February 12, 2012 | jrcuesta

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 ...
[Read more...]

"R": PLS Regression (Gasoline) – 005

February 8, 2012 | jrcuesta

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  &nbs...
[Read more...]

"R": PLS Regression (Gasoline) – 004

February 7, 2012 | jrcuesta

In the previous post we plot the Cross Validation predictions with:__ plot(gas1, ncomp = 3, asp = 1, line = TRUE)We can plot the fitted values instead with:__ plot(gas1, ncomp = 3, asp = 1, line = TRUE,which=train) Graphics are different:Of course, using "train" we get  overoptimisc statistics and we should look better at ...
[Read more...]

"R": PLS Regression (Gasoline) – 003

February 3, 2012 | jrcuesta

The gasoline data set has the spectra of 60 samples acquired by diffuse reflectance from 900 to 1700 nm. We saw how to plot the spectra in the previous post.Now, following the tutorial of Bjorn-Helge Mevik published in "R-News Volume 6/3, August 2006", we will do the PLS regression:gas1 summary(gas1)Data:   X ...
[Read more...]

"R": Plotting the spectra (Gasoline) – 002

February 2, 2012 | jrcuesta

"R" has a package called "ChemometricsWithR", where we can get data from different analytical instruments including Near Infrared (NIR).Follow the steps to plot the spectra of a gasoline data set:In this other case we plot the spectra of the NIR shootout 2002: __ data(shootout)__ wavelengths mattplot(wavelengths,shootout$calibrate.1[1,],...
[Read more...]

"R": Looking at the Data (Gasoline) – 001

February 1, 2012 | jrcuesta

As other softwares "R" has nice tools to look to the data before to develop the calibration.Statistics for the "Y" variable (in this case octane number) like Maximun, Minimun,..,standard deviation,...are important:__ library(ChemometricsWithR)__ data(gasoline)__ summary(gasoline$octane)   Min.  1st Qu.  Median    Mean   3rd Qu.    Max.   83.40   85.88    87.75    87.18   88.45    89.60__ sd(...
[Read more...]

IRIS Flower Data Set (R-003)

December 19, 2011 | jrcuesta

Centramos la matriz con el comando, generando a partir de A una nueva matriz que llamamos "Acentered"Acentered=scale(A,center=T)Ahora con la función "eigen":Esta es otra forma de proceder con el cálculo de los componentes principales (eigenvectors y ...
[Read more...]

IRIS Flower Data Set (R-002)

December 17, 2011 | jrcuesta

Ver  primero: IRIS Flower Data Set (R-001)See first:        IRIS Flower Data Set (R-001)El comando "summary" nos ayuda a comprender la importancia de cada componente principal:Los "eigenvalues" son las desviacion...
[Read more...]

IRIS Flower Data Set (R-001)

December 17, 2011 | jrcuesta

IRIS Flower Data SetEste es el Link a Wikipedia donde podéis encontrar los datos que utilizó Fisher en su trabajo de 1936. Ya hemos trabajado con estos datos en Excel y los continuaremos usando en nuevas entradas.En este link, podemos ver las fotos de las flores (IRIS en castellano ...
[Read more...]

Pairs for the "P" (loadings) matrix

December 12, 2011 | jrcuesta

Ver primero: PCA file calculation with "R"See first:         PCA file calculation with "R"Podemos ver los diferentes planos que forman los PCs entre sí, con la función "Pairs" de "R".We can see all the combinat...
[Read more...]

PCA file calculation with "R".

December 5, 2011 | jrcuesta

X es la matriz centrada (X is the centered matrix). Xcov es la matriz de covarianzas de X (Xcov is the covariance matrix of X).Con la función "eigen" calculamos los "eigenvectors" y "eigenvalues" de Xcov.(With the function "eigen" we calculate the "ei...
[Read more...]
1 2 3 4

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)