Learn R Programming

fpc (version 2.2-13)

plotcluster: Discriminant projection plot.

Description

Plots to distinguish given classes by ten available projection methods. Includes classical discriminant coordinates, methods to project differences in mean and covariance structure, asymmetric methods (separation of a homogeneous class from a heterogeneous one), local neighborhood-based methods and methods based on robust covariance matrices. One-dimensional data is plotted against the cluster number.

Usage

plotcluster(x, clvecd, clnum=NULL,
            method=ifelse(is.null(clnum),"dc","awc"),
            bw=FALSE,
            ignorepoints=FALSE, ignorenum=0, pointsbyclvecd=TRUE,
            xlab=NULL, ylab=NULL,
            pch=NULL, col=NULL, ...)

Arguments

x

the data matrix; a numerical object which can be coerced to a matrix.

clvecd

vector of class numbers which can be coerced into integers; length must equal nrow(xd).

method

one of

"dc"

usual discriminant coordinates, see discrcoord,

"bc"

Bhattacharyya coordinates, first coordinate showing mean differences, second showing covariance matrix differences, see batcoord,

"vbc"

variance dominated Bhattacharyya coordinates, see batcoord,

"mvdc"

added mean and variance differences optimizing coordinates, see mvdcoord,

"adc"

asymmetric discriminant coordinates, see adcoord,

"awc"

asymmetric discriminant coordinates with weighted observations, see awcoord,

"arc"

asymmetric discriminant coordinates with weighted observations and robust MCD-covariance matrix, see awcoord,

"nc"

neighborhood based coordinates, see ncoord,

"wnc"

neighborhood based coordinates with weighted neighborhoods, see ncoord,

"anc"

asymmetric neighborhood based coordinates, see ancoord.

Note that "bc", "vbc", "adc", "awc", "arc" and "anc" assume that there are only two classes.

clnum

integer. Number of the class which is attempted to plot homogeneously by "asymmetric methods", which are the methods assuming that there are only two classes, as indicated above. clnum is ignored for methods "dc" and "nc".

bw

logical. If TRUE, the classes are distinguished by symbols, and the default color is black/white. If FALSE, the classes are distinguished by colors, and the default symbol is pch=1.

ignorepoints

logical. If TRUE, points with label ignorenum in clvecd are ignored in the computation for method and are only projected afterwards onto the resulting units. If pch=NULL, the plot symbol for these points is "N".

ignorenum

one of the potential values of the components of clvecd. Only has effect if ignorepoints=TRUE, see above.

pointsbyclvecd

logical. If TRUE and pch=NULL and/or col=NULL, some hopefully suitable plot symbols (numbers and letters) and colors are chosen to distinguish the values of clvecd, starting with "1"/"black" for the cluster with the smallest clvecd-code (note that colors for clusters with numbers larger than minimum number +3 are drawn at random from all available colors). FALSE produces potentially less reasonable (but nonrandom) standard colors and symbols if method is "dc" or "nc", and will only distinguish whether clvecd=clnum or not for the other methods.

xlab

label for x-axis. If NULL, a default text is used.

ylab

label for y-axis. If NULL, a default text is used.

pch

plotting symbol, see par. If NULL, the default is used.

col

plotting color, see par. If NULL, the default is used.

...

additional parameters passed to plot or the projection methods.

References

Hennig, C. (2004) Asymmetric linear dimension reduction for classification. Journal of Computational and Graphical Statistics 13, 930-945 .

Hennig, C. (2005) A method for visual cluster validation. In: Weihs, C. and Gaul, W. (eds.): Classification - The Ubiquitous Challenge. Springer, Heidelberg 2005, 153-160.

Seber, G. A. F. (1984). Multivariate Observations. New York: Wiley.

Fukunaga (1990). Introduction to Statistical Pattern Recognition (2nd ed.). Boston: Academic Press.

See Also

discrcoord, batcoord, mvdcoord, adcoord, awcoord, ncoord, ancoord.

discrproj is an interface to all these projection methods.

rFace for generation of the example data used below.

Examples

Run this code
set.seed(4634)
face <- rFace(300,dMoNo=2,dNoEy=0)
grface <- as.integer(attr(face,"grouping"))
plotcluster(face,grface)
plotcluster(face,grface==1)
plotcluster(face,grface, clnum=1, method="vbc")

Run the code above in your browser using DataLab