Last chance! 50% off unlimited learning
Sale ends in
Simple bootstrap and jackknife clustering
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,
rect.xpd=TRUE, top=FALSE, lab.pos=3, lab.offset=0.5, lab.col=par("col"),
lab.font=par("font"), ...)
Data
Number of desired clusters
Number of iterations, default 1000
Distance method
Hierarchical clustering method
Bootstrap or jackknife?
If TRUE (default), prints a dot for each replicate
Object of the class 'Jclust'
Plot title
Horizontal axis label
Line type for the rectangles
Color of rectangles
Plot rectangle sides if they go outside the plotting region?
Plot values on top?
Position specifier for the values text labels
Distance of the text labels in fractions of a character width
Color of the text labels
Font of the text labels
Additional arguments to the print() or plot.hclust()
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.)
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().
# NOT RUN {
## 'moldino' data, 1000 iterations
(mo.j <- Jclust(t(moldino), n.cl=3, iter=1000))
plot(mo.j)
## adjust locations of value labels
data.jb <- Jclust(t(atmospheres), method.c="complete", n.cl=3)
plot(data.jb, top=TRUE, lab.pos=1, lab.offset=1, lab.col=2, lab.font=2)
## plot together with Fence()
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