plot.MixtureMissing: MixtureMissing Plotting

View source: R/MixtureMissing.R

plot.MixtureMissingR Documentation

MixtureMissing Plotting

Description

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.

Usage

## S3 method for class '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",
  ...
)

Arguments

x

A MixtureMissing object or an output of select_mixture. In the latter, only the best model will be considered.

what

A string or a character vector specifying the desired plots. See the details section for a list of available plots.

nlevels

Number of contour levels desired; 15 by default.

drawlabels

Contour levels are labelled if TRUE.

addpoints

Colored points showing cluster memberships are added if TRUE.

cex.point

A numerical value giving the amount by which data points should be magnified relative to the default.

cex.axis

The magnification to be used for axis annotation.

cex.labels

A numerical value to control the character size of variable labels.

lwd

The contour line width, a positive number, defaulting to 1.

col_line

The color of contour; "gray" by default.

...

Arguments to be passed to methods, such as graphical parameters.

Details

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.

Value

No return value, called to visualize the fitted model's results

Examples


set.seed(123)
X <- hide_values(iris[, 1:4], n_cases = 20)
mod <- MCNM(X, G = 2, max_iter = 10)
plot(mod, what = 'classification')


MixtureMissing documentation built on Oct. 16, 2024, 1:09 a.m.