#PCAMIX:
data(wine)
X.quanti <- wine[,c(3:29)]
X.quali <- wine[,c(1,2)]
pca<-PCAmix(X.quanti,X.quali,ndim=4)
pca<-PCAmix(X.quanti,X.quali,ndim=4,graph=FALSE)
pca$eig
#Scores on dim 1-2
plot(pca,choice="ind",quali=wine[,1],
posleg="bottomleft",main="Scores")
#Scores on dim 2-3
plot(pca,choice="ind",axes=c(2,3),quali=wine[,1],
posleg="bottomleft",main="Scores")
#Other graphics
plot(pca,choice="var",main="Squared loadings")
plot(pca,choice="categ",main="Categories")
plot(pca,choice="cor",xlim=c(-1.5,2.5),
main="Correlation circle")
#plot with standardized scores:
plot(pca,choice="ind",quali=wine[,1],stand=TRUE,
posleg="bottomleft",main="Standardized Scores")
plot(pca,choice="var",stand=TRUE,main="Squared loadings")
plot(pca,choice="categ",stand=TRUE,main="Categories")
plot(pca,choice="cor",stand=TRUE,main="Correlation circle")
#PCA:
data(decathlon)
quali<-decathlon[,13]
pca<-PCAmix(decathlon[,1:10])
pca<-PCAmix(decathlon[,1:10], graph=FALSE)
plot(pca,choice="ind",quali=quali,cex=0.8,
posleg="topright",main="Scores")
plot(pca, choice="var",main="Squared correlations")
plot(pca, choice="cor",main="Correlation circle")
#MCA
data(flower)
mca <- PCAmix(X.quali=flower[,1:4])
mca <- PCAmix(X.quali=flower[,1:4],graph=FALSE)
plot(mca,choice="ind",main="Scores")
plot(mca,choice="var",main="Correlation ratios")
plot(mca,choice="categ",main="Categories")
#Missing values
data(vnf)
PCAmix(X.quali=vnf)
vnf2<-na.omit(vnf)
PCAmix(X.quali=vnf2)
Run the code above in your browser using DataLab