We can see the 3D cube score plots, draw the orthogonal projections to the different planes (in this case to the plane formed by PC1 and PC2, and so on
library(scatterplot3d)
scatterplot3d(T1_nipals,T2_nipals,T3_nipals)
scatterplot3d (T1_nipals,T2_nipals,T3_nipals,
+pch=16,highlight.3d=TRUE,type="h")
We can draw also this plot and rotate it with the mouse to get the orientation we prefer.
library(rgl)
plot3d(T1_nipals,T2_nipals,T3_nipals,col="red",size=5)
Another nice plot that we can rotate with the mouse is this one:
library(Rcmdr)
scatter3d(sflw.msc3.tra$G00rmn,T2_nipals,ç
In this case one of the axes is the constituent, and we can see the patterns of correlation between the constituent and the scores.
If interested in this type of plots, you can read the post: 3D plots in R from the Revolution blog.
Once we have our PCA space, objects can be projected into the PCA space, the distance from the object to this projection is the orthogonal distance (O.D.), this projection will have a score distance (S.D), respect to the center and for every PC.
We can have three kinds of situations:
- Large O.D. but short S.D
- Large O.D and large S.D. (Bad leverage point)
- Short O.D and large S.D. (Good leverage point)
pcaDiagplot(sflw.msc3.tra$NIRmsc,X.pca=X_nipals,
+ a=4,pch=c(20:24)[sflw.msc3.tra$Operator],
+ col=c("red","blue","green","brown")
+ [sflw.msc3.tra$Operator])
In the table of distances, we can check the outliers for the O.D and S.D. We have three samples which have a large OD and a large SD at the same time (14,80,87), two samples with a large OD but the SD into the limits (79,85), and two samples with a large SD, but the OD is into the limits (19,86).
outliers<-sflw.msc3.tra$NIRmsc[c(14,80,87,79,85,19,86),]
matplot(wave.NIR,t(outliers),type="l",lty=1,xlab="nm",
+ ylab="log 1/R")