#PCAMIX:
data(wine)
X.quanti <- wine[,c(3:29)]
X.quali <- wine[,c(1,2)]
pca<-PCAmix(X.quanti,X.quali,ndim=4, graph=FALSE)
pca
rot<-PCArot(pca,3)
rot
rot$eig #percentages of variances after rotation
plot(rot,choice="ind",quali=wine[,1],
posleg="bottomleft", main="Rotated scores")
plot(rot,choice="var",main="Squared loadings after rotation")
plot(rot,choice="categ",main="Categories after rotation")
plot(rot,choice="cor",main="Correlation circle after rotation")
#PCA:
data(decathlon)
quali<-decathlon[,13]
pca<-PCAmix(decathlon[,1:10], graph=FALSE)
rot<-PCArot(pca,3)
plot(rot,choice="ind",quali=quali,cex=0.8,
posleg="topright",main="Scores after rotation")
plot(rot, choice="var", main="Squared correlations after rotation")
plot(rot, choice="cor", main="Correlation circle after rotation")
#MCA
data(flower)
mca <- PCAmix(X.quali=flower[,1:4],graph=FALSE)
rot<-PCArot(mca,2)
plot(rot,choice="ind",main="Scores after rotation")
plot(rot, choice="var", main="Correlation ratios after rotation")
plot(rot, choice="categ", main="Categories after rotation")
Run the code above in your browser using DataLab