Cuts a hierarchical tree of variables resulting from hclustvar
into
several clusters by specifying the desired number of clusters.
cutreevar(obj, k = NULL, matsim = FALSE)
an object of class 'hclustvar'.
an integer scalar with the desired number of clusters.
boolean, if TRUE, the matrices of similarities between variables in same cluster are calculated.
a list of matrices of squared loadings i.e. for each cluster of variables, the squared loadings on first principal component of PCAmix. For quantitative variables (resp. qualitative), squared loadings are the squared correlations (resp. the correlation ratios) with the first PC (the cluster center).
a list of matrices of similarities
i.e. for each cluster, similarities between their variables. The
similarity between two variables is defined as a square cosine: the square
of the Pearson correlation when the two variables are quantitative; the
correlation ratio when one variable is quantitative and the other one is
qualitative; the square of the canonical correlation between two sets of
dummy variables, when the two variables are qualitative. sim
is
'NULL' if 'matsim' is 'FALSE'.
a vector of integers indicating the cluster to which each variable is allocated.
the within-cluster sum of squares for each cluster: the sum of the correlation ratio (for qualitative variables) and the squared correlation (for quantitative variables) between the variables and the center of the cluster.
the pourcentage of homogeneity which is accounted by the partition in k clusters.
the number of variables in each cluster.
a n by k numerical matrix which contains the k
cluster centers. The center of a cluster is a synthetic variable: the first
principal component calculated by PCAmix. The k columns of scores
contain the scores of the n observations units on the first PCs of the k
clusters.
a list of the coefficients of the linear combinations defining the synthetic variable of each cluster.
# NOT RUN {
data(decathlon)
tree <- hclustvar(decathlon[,1:10])
plot(tree)
#choice of the number of clusters
stability(tree,B=40)
part <- cutreevar(tree,4)
print(part)
summary(part)
# }
Run the code above in your browser using DataLab