21 ene 2018

Analyzing Soy Meal in transmitance (part 3)

This is the third of the posts about analyzing soy meal unground in an Infratec, adding the sample directly to the conveyor in the same way that we do with wheat or barley. The range wavelength in the Infratec is from 850 to 1050nm, in steps of 2 nm, so we have a total of 100 data points.
We can change the scale of the loading plots we have seen in the last post in order to over-plot them with the scores of the samples in the plane formed by the first two principal components.
So first step is to change the scale of the plot in the left to the scale on the right:
Now if we use the biplot function, we can see the scores and the loadings in the same plot:
biplot(X_msc_prcomp)

we see that all the samples are quite grouped in this plane, but there are samples (373 and 298) which are out of the group, specially in the direction of the second PC.
we want to keep these samples in a set called "extremes", to check them apart.
extremes<-c(298,373)
X_msc_extr<-scale(X_msc,scale=FALSE)[extremes,]
matplot(wavelengths,t(X_msc_extr),type="l",

        xlab="Wavelengths (nm)",ylab="Intensity (mean-scaled")
Now we can compare these samples with all the samples in the data set (including the extremes).
We can identify clearly sample 298 in the two plots, but 373 is not easy to see on the left plot, but it is in the direction of sample 298, so we can see the constituents values of this samples to have an idea why they are extremes in the second PC.




No hay comentarios:

Publicar un comentario