{
data(NCI60Selec)
Z1<-DiStatis(NCI60Selec)
M1<-SelectVar(Z1,Crit="R2-Adj")
Colores1<-c(rep("Breast",5),rep("CNS",6),rep("Colon",7),
rep("Leukemia",6),rep("Melanoma",10),rep("Lung",9),
rep("Ovarian",7),rep("Prostate",2),rep("Renal",8))
Colores2<-c(rep(colors()[657],5),rep(colors()[637],6),
rep(colors()[537],7),rep(colors()[552],6),rep(colors()[57],10)
,rep(colors()[300],9),rep(colors()[461],7),rep(colors()[450],2)
,rep(colors()[432],8))
Biplot(M1,labelObs = FALSE,labelVars=FALSE,
colObs=Colores2,Type="SQRT",las=1,cex.axis=0.8,
cex.lab=0.8,xlimi=c(-3,3),ylimi=c(-3,3))
legend("topright",unique(Colores1),col=unique(Colores2),
bty="n",pch=16,cex=0.6)
Biplot(M1,labelObs = FALSE,labelVars=TRUE,colObs=Colores2,
Type="SQRT",las=1,cex.axis=0.8,cex.lab=0.8,xlimi=c(-3,3),
ylimi=c(-3,3),Groups=TRUE,NGroups=6)
legend("topright",unique(Colores1),col=unique(Colores2),
bty="n",pch=16,cex=0.6)
data(winesassesors)
Z3<-DiStatis(winesassesors)
M3<-SelectVar(Z3,Crit="R2-Adj")
Col1<-c(rep("NZ",4),rep("FR",4),rep("CA",4))
Col2<-c(rep(2,4),rep(3,4),rep(4,4))
Biplot(M3,labelObs=FALSE,labelVars=TRUE,colObs=Col2,
Type="SQRT",xlimi=c(-2,2),ylimi=c(-2,2),las=1,cex.axis=0.8,
cex.lab=0.8)
legend("topright",unique(Col1),col=unique(Col2),bty="n",pch=16,cex=0.8)
Biplot(M1,labelObs = FALSE,labelVars=FALSE,colObs=Colores2,
Type="CMP")
legend("topright",unique(Colores1),
col=unique(Colores2),bty="n",pch=16,cex=1)
}Run the code above in your browser using DataLab