This function implements MCA K-means (Hwang, Dillon and Takane, 2006), i-FCB (Iodice D' Enza and Palumbo, 2013) and Cluster Correspondence Analysis (van de Velden, Iodice D' Enza and Palumbo, 2017). The methods combine variants of Correspondence Analysis for dimension reduction with K-means for clustering.
clusmca(data, nclus, ndim, method=c("clusCA","iFCB","MCAk"),
alphak = .5, nstart = 100, smartStart = NULL, gamma = TRUE,
seed = 1234)# S3 method for clusmca
print(x, …)
# S3 method for clusmca
summary(object, …)
# S3 method for clusmca
fitted(object, mth = c("centers", "classes"), …)
Dataset with categorical variables
Number of clusters (nclus = 1 returns the MCA solution; see Details)
Dimensionality of the solution
Specifies the method. Options are MCAk for MCA K-means, iFCB for Iterative Factorial Clustering of Binary variables and clusCA for Cluster Correspondence Analysis (default = "clusCA")
Non-negative scalar to adjust for the relative importance of MCA (alphak = 1
) and K-means (alphak = 0
) in the solution (default = .5). Works only in combination with method = "MCAk"
Number of random starts (default = 100)
If NULL
then a random cluster membership vector is generated. Alternatively, a cluster membership vector can be provided as a starting solution
Scaling parameter that leads to similar spread in the object and variable scores (default = TRUE
)
An integer that is used as argument by set.seed()
for offsetting the random number generator when smartStart = NULL
. The default value is 1234
For the print
method, a class of clusmca
For the summary
method, a class of clusmca
For the fitted
method, a character string that specifies the type of fitted value to return: "centers"
for the observations center vector, or "class"
for the observations cluster membership value
Not used
Object scores
Variable scores
Cluster centroids
Cluster membership
Optimal value of the objective criterion
The number of objects in each cluster
A copy of nstart
in the return object
A copy of data
in the return object
For the K-means part, the algorithm of Hartigan-Wong is used by default.
The hidden print
and summary
methods print out some key components of an object of class clusmca
.
The hidden fitted
method returns cluster fitted values. If method is "classes"
, this is a vector of cluster membership (the cluster component of the "clusmca" object). If method is "centers"
, this is a matrix where each row is the cluster center for the observation. The rownames of the matrix are the cluster membership values.
When nclus
= 1 the function returns the MCA solution with objects in principal and variables in standard coordinates (plot(object)
shows the corresponding asymmetric biplot).
Hwang, H., Dillon, W. R., and Takane, Y. (2006). An extension of multiple correspondence analysis for identifying heterogenous subgroups of respondents. Psychometrika, 71, 161-171.
Iodice D'Enza, A., and Palumbo, F. (2013). Iterative factor clustering of binary data. Computational Statistics, 28(2), 789-807.
van de Velden M., Iodice D' Enza, A., and Palumbo, F. (2017). Cluster correspondence analysis. Psychometrika, 82(1), 158-185.
# NOT RUN {
data(cmc)
# Preprocessing: values of wife's age and number of children were categorized
# into three groups based on quartiles
cmc$W_AGE = ordered(cut(cmc$W_AGE, c(16,26,39,49), include.lowest = TRUE))
levels(cmc$W_AGE) = c("16-26","27-39","40-49")
cmc$NCHILD = ordered(cut(cmc$NCHILD, c(0,1,4,17), right = FALSE))
levels(cmc$NCHILD) = c("0","1-4","5 and above")
#Cluster Correspondence Analysis solution with 3 clusters in 2 dimensions
#after 10 random starts
outclusCA = clusmca(cmc, 3, 2, method = "clusCA", nstart = 10)
outclusCA
#Scatterplot (dimensions 1 and 2)
plot(outclusCA)
#MCA K-means solution with 3 clusters in 2 dimensions after 10 random starts
outMCAk = clusmca(cmc, 3, 2, method = "MCAk", nstart = 10)
outMCAk
#Scatterplot (dimensions 1 and 2)
plot(outMCAk)
#nclus = 1 just gives the MCA solution
#outMCA = clusmca(cmc, 1, 2)
#outMCA
#Scatterplot (dimensions 1 and 2)
#asymmetric biplot with scaling gamma = TRUE
#plot(outMCA)
# }
Run the code above in your browser using DataLab