Learn R Programming

ClustVarLV (version 1.3.2)

CLV_kmeans: K-means algorithm for the clustering of variables

Description

K-means algorithm for the clustering of variables. Directional or local groups may be defined. Each group of variables is associated with a latent component. Moreover external information collected on the observations or on the variables may be introduced.

Usage

CLV_kmeans(X, Xu = NULL, Xr = NULL, method, sX = TRUE, sXr = FALSE,
  sXu = FALSE, init, iter.max = 20, nstart = 100, strategy = "none",
  rho = 0.3)

Arguments

X
The matrix of the variables to be clustered
Xu
The external variables associated with the columns of X
Xr
The external variables associated with the rows of X
method
The criterion to use in the cluster analysis. 1 : the squared covariance is used as a measure of proximity (directional groups). 2 : the covariance is used as a measure of proximity (local groups)
sX
TRUE/FALSE : standardization or not of the columns X (TRUE by default) (predefined -> cX = TRUE : column-centering of X)
sXr
TRUE/FALSE : standardization or not of the columns Xr (FALSE by default) (predefined -> cXr = TRUE : column-centering of Xr)
sXu
TRUE/FALSE : standardization or not of the columns Xu (FALSE by default) (predefined -> cXu= FALSE : no centering, Xu considered as a weight matrix)
init
a number i.e. the size of the partition, K, or a vector of INTEGERS i.e. the group membership of each variable in the initial partition (integer between 1 and K)
iter.max
maximal number of iteration for the consolidation (20 by default)
nstart
nb of random initialisations in the case where init is a number (100 by default)
strategy
"none" (by default), or "kplusone" (an additional cluster for the noise variables), or "sparselv" (zero loadings for the noise variables)
rho
a threshold of correlation between 0 and 1 (0.3 by default)

Value

  • tabresThe value of the clustering criterion at convergence. The percentage of the explained initial criterion value. The number of iterations in the partitioning algorithm.
  • clustersthe group's membership
  • compThe latent components of the clusters
  • loadingif there are external variables Xr or Xu : The loadings of the external variables

Details

The initalization can be made at random, repetitively, or can be defined by the user. The parameter "strategy" makes it possible to choose a strategy for setting aside variables that do not fit into the pattern of any cluster.

See Also

CLV, LCLV

Examples

Run this code
data(apples_sh)
#local groups with external variables Xr
resclvkmYX <- CLV_kmeans(X = apples_sh$pref, Xr = apples_sh$senso,
                         method = 2, sX = FALSE, sXr = TRUE, init = 2, nstart = 20)

Run the code above in your browser using DataLab