Once we have calculated the scores matrix (PC_scores) we can draw the scores maps, and over them the Mahalanobis distance ellipses.
We must be cautious about this, because we can do it in the classical or robust way and that depends of how we calculate the Covariance matrix. In this case I use the "chemometric" package and compare both. Look at the difference, which is quite large.
Clearly the robust one find the grouping of samples and detects as outliers the rest. Is this really what we want?.
We have to check that group characteristics and see if it would be necessary to create a group apart or to remove redundant samples in that group to give more weight to the rest of the samples, so the ellipse will change.
drawMahal(PC_scores[,c(1,2)],
center=apply(PC_scores[,c(1,2)],2,mean),
covariance= cov(PC_scores[,c(1,2)]),
quantile =0.975)
drawMahal(PC_scores,
T_mcd$center,
covariance= T_mcd$cov,
quantile =0.975)
No hay comentarios:
Publicar un comentario