ward.cluster | R Documentation |
Performs the classification by Ward's method from the matrix of Euclidean distances.
ward.cluster(dista, peso = NULL , plots = TRUE, h.clust = 2, n.indi = 25 )
dista |
matrix of Euclidean distances ( class(dista)=="dist" ). |
peso |
(Optional) weight of the individuals, by default equal weights |
plots |
it makes dendrogram and histogram of the Ward's method |
h.clust |
if it is '0' returns a object of class |
n.indi |
number of indices to draw in the histogram (default 25). |
It is an entrance to the function h.clus
to obtain the results of the procedure presented in
Lebart et al. (1995). Initially the matrix of distances of Ward of the elements to classify is calculated:
The Ward's distance between two elements to classify $i$ and $l$ is given by:
W(i,l) = (m_i * m_l)/(m_i + m_i) * dist(i,l)^2
where $m_i$ y $m_l$ are the weights and $dist(i,l)$ is the Euclidean distance between them.
It returns an object of class hclust and a table of level indices (depending of h.clust). If plots = TRUE it draws the indices of level and the dendrogram.
Pedro Cesar del Campo pcdelcampon@unal.edu.co, Campo Elias Pardo cepardot@unal.edu.co
Lebart, L. and Morineau, A. and Piron, M. (1995) Statisitique exploratoire multidimensionnelle, Paris.
data(ardeche)
ca <- dudi.coa(ardeche$tab,scannf=FALSE,nf=4)
ward.cluster( dista= dist(ca$li), peso=ca$lw )
dev.new()
HW <- ward.cluster( dista= dist(ca$li), peso=ca$lw ,h.clust = 1)
plot(HW)
rect.hclust(HW, k=4, border="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.