Provide four model-based clustering plots for a MixtureMissing
object. The options
include (1) pairwise scatter plots showing cluster memberships and highlighting outliers denoted by triangles;
(2) pairwise scatter plots highlighting in red observations whose values are missing but are replaced by
expectations obtained in the EM algorithm; (3) parallel plot of up to the first 10 variables of a multivariate
data set; and (4) plots of estimated density in the form of contours. A single or multiple options
can be specified. In the latter case, interactive mode will be triggered for the user to choose.
# S3 method for MixtureMissing
plot(
x,
what = c("classification", "missing", "parallel", "density"),
nlevels = 15,
drawlabels = TRUE,
addpoints = TRUE,
cex.point = 1,
cex.axis = 1,
cex.labels = 2,
lwd = 1,
col_line = "gray",
...
)
No return value, called to visualize the fitted model's results
A MixtureMissing
object or an output of select_mixture.
In the latter, only the best model will be considered.
A string or a character vector specifying the desired plots. See the details section for a list of available plots.
Number of contour levels desired; 15 by default.
Contour levels are labelled if TRUE
.
Colored points showing cluster memberships are added if TRUE
.
A numerical value giving the amount by which data points should be magnified relative to the default.
The magnification to be used for axis annotation.
A numerical value to control the character size of variable labels.
The contour line width, a positive number, defaulting to 1.
The color of contour; "gray" by default.
Arguments to be passed to methods, such as graphical parameters.
The plots that can be retrieved include
If what = "classification"
- Pairwise scatter plots showing cluster memberships
and highlighting outliers denoted by triangles.
If what = "missing"
- Pairwise scatter plots highlighting in red observations
whose values are missing but are replaced by expectations obtained in the EM algorithm.
If what = "parallel"
- Parallel plot of up to the first 10 variables of a multivariate
data set.
If what = "density"
- Plots of estimated density in the form of contours.
set.seed(123)
X <- hide_values(iris[, 1:4], n_cases = 20)
mod <- MCNM(X, G = 2, max_iter = 10)
plot(mod, what = 'classification')
Run the code above in your browser using DataLab