Under all these post about Analyzing Soy meal in transmitance there is the excuse to work with "R" and to see a lot of chemometric functions which the available R packages offer.
So continuing with this this is the fifth post about it.
We are more use to see the Mahalanobis distance with ellipses, so let see the same as in the previous post with the "drawMahal" function of the Chemometric package.
First we use the Nipals algorithm to calculate the score matrix T and the loading matrix P with the X matrix with the Math treatment MSC (Multiple Scatter Correction).
X_msc_nipals<-nipals(X_msc,a=2)
T_msc<-X_msc_nipals$T
P_msc<-X_msc_nipals$P
drawMahal(T_msc,center=apply(T_msc,2,mean),
covariance=cov(T_msc),
quantile=0.975,col="blue",
xlab="PC1",ylab="PC2")
identify(T_msc)
As we can see we have the same outliers, but we see them in a different way.
No hay comentarios:
Publicar un comentario