cluspcamix()
output.Plotting function that creates a scatterplot of the objects, a correlation circle of the variables or a biplot of both objects and variables. Optionally, for metric variables, it returns a parallel coordinate plot showing cluster means and for categorical variables, a series of barplots showing the standardized residuals per attribute for each cluster.
# S3 method for cluspcamix
plot(x, dims = c(1, 2), cludesc = FALSE,
topstdres = 20, attlabs = NULL, subplot = FALSE,
what = c(TRUE,TRUE), …)
Object returned by cluspcamix()
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
Vector of two logical values specifying the contents of the plots. First entry indicates whether a scatterplot of the objects and cluster centroids is displayed and the second entry whether a correlation circle of the variables is displayed. The default is c(TRUE, TRUE)
and the resultant plot is a biplot of both objects and variables
A logical value indicating if a parallel coordinate plot showing cluster means is produced (default = FALSE)
Number of largest standardized residuals used to describe each cluster (default = 20). Works only in combination with cludesc = TRUE
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 cludesc = TRUE
Vector of custom attribute labels; if not provided, default labeling is applied
Further arguments to be transferred to cluspcamix()
The function returns a ggplot2 scatterplot of the solution obtained via cluspcamix()
that can be further customized using the ggplot2 package. When cludesc = TRUE
, for metric variables, the function also returns a ggplot2 parallel coordinate plot and for categorical variables, a series of ggplot2 barplots showing the largest (or all) standardized residuals per attribute for each cluster.
van de Velden, M., Iodice D'Enza, A., & Markos, A. (2019). Distance-based clustering of mixed data. Wiley Interdisciplinary Reviews: Computational Statistics, e1456.
Vichi, M., Vicari, D., & Kiers, H. A. L. (2019). Clustering and dimension reduction for mixed variables. Behaviormetrika. doi:10.1007/s41237-018-0068-6.
# NOT RUN {
data(diamond)
#Mixed Reduced K-means solution with 3 clusters in 2 dimensions
#after 10 random starts
outmixedRKM = cluspcamix(diamond, 3, 2, method = "mixedRKM", nstart = 10)
#Scatterplot (dimensions 1 and 2)
plot(outmixedRKM, cludesc = TRUE)
# }
Run the code above in your browser using DataLab