clusmca | R Documentation |
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, inboot = FALSE, seed = NULL) ## S3 method for class 'clusmca' print(x, ...) ## S3 method for class 'clusmca' summary(object, ...) ## S3 method for class 'clusmca' fitted(object, mth = c("centers", "classes"), ...)
data |
Dataset with categorical variables |
nclus |
Number of clusters (nclus = 1 returns the MCA solution; see Details) |
ndim |
Dimensionality of the solution |
method |
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 = |
alphak |
Non-negative scalar to adjust for the relative importance of MCA ( |
nstart |
Number of random starts (default = 100) |
smartStart |
If |
gamma |
Scaling parameter that leads to similar spread in the object and variable scores (default = |
seed |
An integer that is used as argument by |
inboot |
Used internally in the bootstrap functions to perform bootstrapping on the indicator matrix. |
x |
For the |
object |
For the |
mth |
For the |
... |
Not used |
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.
obscoord |
Object scores |
attcoord |
Attribute scores |
centroid |
Cluster centroids |
cluster |
Cluster membership |
criterion |
Optimal value of the objective criterion |
size |
The number of objects in each cluster |
nstart |
A copy of |
odata |
A copy of |
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.
cluspca
, cluspcamix
, tuneclus
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, seed = 1234) 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, seed = 1234) 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.