[R] Cluster Analysis - Number of Clusters

TEMPL Matthias Matthias.Templ at statistik.gv.at
Mon Feb 6 14:48:40 CET 2006


Dear John,

You can play around with cluster.stats function in library fpc, e.g. you
can try:

library(fpc)
library(cluster)
data(xclara)
dM <- dist(xclara)
cl <- vector()
for(i in 2:7){
  cl[i] <- cluster.stats(d=dM, clustering=clara(d,i)$cluster,
silhouette=FALSE)$wb.ratio
}
plot(1:6,cl[2:7], xaxt="n")
axis(1, at=1:6, labels=2:7)

(..takes some minutes time)
indicates that 3 clusters are "optimal" for this data.

Best,
Matthias


> 
> Hello,
> 
> I'm playing around with cluster analysis, and am looking for 
> methods to 
> select the number of clusters.  I am aware of methods based 
> on a 'pseudo 
> F' or a 'pseudo T^2'.  Are there packages in R that will 
> generate these 
> statistics, and/or other statistics to aid in cluster number 
> selection?
> 
> Thanks,
> 
> John.
> -- 
> ==============================================================
> =============
> Dr. John Janmaat                       Tel: 902-585-1461
> Department of Economics                Fax: 902-585-1070
> Acadia University                      Email: jjanmaat at acadiau.ca
> Wolfville, Nova Scotia, Canada.        Web: ace.acadiau.ca/~jjanmaat/
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read 
> the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list