Hi
With the following test file
,V1,V2,V3,V4
P1,73.6,0.7,74.6,3.1
P2,75.2,0.7,75.8,2.8
P3,6.5,0.0,7.3,2.5
P4,41.4,0.3,39.2,8.9
P4,5.4,0.1,18.2,1.1
P5,18.8,0.3,30.3,7.3
I tried to run a PCA analysis with factominer.
> library(FactoMineR)
> mydata <- read.csv('test.csv', header=T)
> head(mydata)
X V1 V2 V3 V4
1 P1 73.6 0.7 74.6 3.1
2 P2 75.2 0.7 75.8 2.8
3 P3 6.5 0.0 7.3 2.5
4 P4 41.4 0.3 39.2 8.9
5 P4 5.4 0.1 18.2 1.1
6 P5 18.8 0.3 30.3 7.3
When I run
res.pca = PCA(mydata[,2:5], scale.unit=TRUE, graph=T)
I see
https://pasteboard.co/JMQJdrHf.png with Dim1 (74.1%) and Dim2(25%).
I have these questions:
1- How can I specify which principal components to show? Since
74.1+25<100 it seems that there is another PC. I would like to see
PC1-PC3 and PC2-PC3.
2- As you can see in the picture, in the indices (row numbers) are
shown in the chart. I would like to see P1~P5 on the chart. How can I
do that?
Regards,
Mahmood