Learn R Programming

shipunov (version 1.11)

Jclust: Simple bootstrap and jackknife clustering

Description

Simple bootstrap and jackknife clustering

Usage

Jclust(data, n.cl, iter=1000, method.d="euclidean", method.c="ward.D",
 bootstrap=TRUE, monitor=TRUE)

# S3 method for Jclust print(x, ...)

# S3 method for Jclust plot(x, main="", xlab=NULL, rect.lty=3, rect.col=1, top=FALSE, rect.xpd=TRUE, ...)

Arguments

data

Data

n.cl

Number of desired clusters

iter

Number of iterations, default 1000

method.d

Distance method

method.c

Hierarchical clustering method

bootstrap

Bootstrap or jackknife?

monitor

If TRUE (default), prints a dot for each replicate

x

Object of the class 'Jclust'

main

Plot title

xlab

Horizontal axis label

rect.lty

Line type for the rectangles

rect.col

Color of rectangles

top

Plot values on top?

rect.xpd

Plot rectangle sides if they go outside the plotting region?

...

Additional arguments to the print() or plot.hclust()

Value

Returns 'Jclust' object which is a list with components "meth" (bootstrap or jacknife), "mat" (matrix of results, consensus matrix), "hclust" (consensus tree as 'hclust' object), "gr" (groups), "supp" (support values), "iter" (number of iterations) and "n.cl" (number of cluters used.)

Details

Simple method to bootstrap and jackknife cluster memberships, and plot consensus membership tree. Requires the desired number of clusters.

The default clustering method is the variance-minimizing "ward.D" (which works better with Euclidean distances); to make it coherent with hclust() default, specify 'method.c="complete"'.

Note that Jclust() is fast indirect bootstrap, it boostrap the consensus (not the original) tree and narrows results with the desired number of clusters. Please consider also Bclust() which is the direct method, and phylogeny-based BootA().

See Also

Bclust, BootA

Examples

Run this code
# NOT RUN {
(mo.j <- Jclust(t(moldino), n.cl=3, iter=1000))
plot(mo.j)

iris.jb <- Jclust(iris[, -5], n.cl=3)
plot(iris.jb, labels=FALSE)
Fence(iris.jb$hclust, iris$Species)
legend("topright", legend=levels(iris$Species), col=1:3, lwd=2.5, bty="n")

# }
# NOT RUN {
## This is how one can bootstrap _all_ reliable cluster numbers:
for (i in 2:(nrow(t(moldino)) - 1)) print(Jclust(t(moldino), i, iter=1000, boot=TRUE))
# }

Run the code above in your browser using DataLab