Description Usage Arguments Value References See Also Examples

Plotting function that creates a scatterplot of the object scores and/or the attribute scores and the cluster centroids. Optionally, the function returns a series of barplots showing the standardized residuals per attribute for each cluster.

1 2 3 |

`x` |
Object returned by |

`dims` |
Numerical vector of length 2 indicating the dimensions to plot on horizontal and vertical axes respectively; default is first dimension horizontal and second dimension vertical |

`what` |
Vector of two logical values specifying the contents of the plots. First entry indicates whether a scatterplot of the objects is displayed in principal coordinates. Second entry indicates whether a scatterplot of the attribute categories is displayed in principal coordinates. Cluster centroids are always displayed. The default is |

`cludesc` |
A logical value indicating whether a series of barplots is produced showing the largest (in absolute value) standardized residuals per attribute for each cluster (default = |

`topstdres` |
Number of largest standardized residuals used to describe each cluster (default = 20). Works only in combination with |

`attlabs` |
Vector of custom attribute labels; if not provided, default labeling is applied |

`subplot` |
A logical value indicating whether a subplot with the full distribution of the standardized residuals will appear at the bottom left corner of the corresponding plots. Works only in combination with |

`binary` |
A logical value indicating whether the visualization refers to a dataset of binary variables |

`...` |
Further arguments to be transferred to |

The function returns a ggplot2 scatterplot of the solution obtained via `clusmca()`

that can be further customized using the ggplot2 package. When `cludesc = TRUE`

the function also returns a series of ggplot2 barplots showing the largest (or all) standardized residuals per attribute for each cluster.

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
data("hsq")
#Cluster Correspondence Analysis with 3 clusters in 2 dimensions after 10 random starts
outclusCA = clusmca(hsq[,1:8], 3, 2, nstart = 10)
#Save the ggplot2 scatterplot
map = plot(outclusCA)$map
#Customization (adding titles)
map + ggtitle(paste("Cluster CA plot of the hsq data: 3 clusters of sizes ",
paste(outclusCA$size, collapse = ", "),sep = "")) +
xlab("Dim. 1") + ylab("Dim. 2") +
theme(plot.title = element_text(size = 10, face = "bold", hjust = 0.5))
data("hsq")
#i-FCB with 4 clusters in 3 dimensions after 10 random starts
outclusCA = clusmca(hsq[,1:8], 4, 3, method = "iFCB", nstart= 10)
#Scatterlot with the observations only (dimensions 1 and 3)
#and cluster description plots showing the 20 largest std. residuals
#(with the full distribution showing in subplots)
plot(outclusCA, dim = c(1,3), what = c(TRUE, FALSE), cludesc = TRUE,
subplot = TRUE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.