23 jun 2013

Score Matrix "T" in 3D

We have seen the score matrix, several times in this blog. Now, I create a vector with the scores values for every sample for the first 3 Principal components, or Loadings.
Tcomp1<-T[,1]  ........................T values for the first PC
Tcomp2<-T[,2]  ........................T values for the second PC
Tcomp3<-T[,3]  ........................T values for the third PC

Now there are diferent options to see this T matrix in 3D:
One of them can be:
library(scatterplot3d)scatterplot3d(Tcomp1,Tcomp2,Tcomp3)
 and we get a plot.

Other way is to use the package:
library(rgl)
plot3d(Tcomp1,Tcomp2,Tcomp3,col="red",size=5)

We can move the plot with the mouse and see the different faces of the cube. 

No hay comentarios:

Publicar un comentario