r - hcpc and hclust functions give different results for mixed classification -
i started hierarchical classification on mixed datas using "hclust". however, results not contain details variables importance each cluster. that's why did classification using "hcpc" give these details.
my question following : why results of 2 hierarchical classifications different ? (for example, in first classification, there 881 individuals in first cluster, there 679 individuals in first cluster second classification)
dtf.year <- read.table(file="studies/dtf.year.txt", sep="\t", header=t) #hclust library(ade4) year.afdm <- dudi.mix(dtf.year,scannf=f,nf=2) dist.year <- dist(year.afdm$li[,1:2],method="euclidian") dist.year <- dist.year^2 year.tree <- hclust(dist.year,method="ward.d") #i tried ward.d2 year.clusters <- cutree(year.tree, k=3) table(year.clusters) > 1 2 3 881 225 535 #hcpc library(factominer) year.afdm <- famd(dtf.year, ncp=2) year.tree2 <- hcpc(year.afdm , method="ward",order=false) table(year.tree2$data.clust$clust) > 1 2 3 679 267 695
any welcome!
best wishes, tang'
Comments
Post a Comment