ACLUST {easyCODA} | R Documentation |
Amalgamation clustering of the parts of a compositional data matrix
Description
This function clusters the parts of a compositional data matrix, using amalgamation of the parts at each step.
Usage
ACLUST(data, weight = TRUE, close = TRUE)
Arguments
data |
Compositional data matrix, with the parts as columns |
weight |
|
close |
|
Details
The function ACLUST
performs amalgamation hierarchical clustering on the parts (columns) of a given compositional data matrix, as proposed by Greenacre (2019).
At each step of the clustering two clusters are amalgamated that give the least loss of explained logratio variance.
Value
An object which describes the tree produced by the clustering process on the n objects. The object is a list with components:
merge |
an n-1 by 2 matrix. Row i of |
height |
a set of n-1 real values (non-decreasing for ultrametric trees). The clustering height: that is, the value of the criterion associated with the clustering method for the particular agglomeration. |
order |
a vector giving the permutation of the original observations suitable for plotting, in the sense that a cluster plot using this ordering and matrix merge will not have crossings of the branches |
labels |
a vector of column labels, the column names of |
Author(s)
Michael Greenacre
References
Greenacre, M. (2018), Compositional Data Analysis in Practice, Chapman & Hall / CRC.
Greenacre, M. (2019), Amalgamations are valid in compositional data analysis,
can be used in agglomerative clustering, and their
logratios have an inverse transformation.
Applied Computing and Geosciences, open access.
See Also
hclust
, WARD
,CLR
, LR.VAR
,
CLOSE
Examples
data(cups)
# amalgamation clustering (weighted parts)
cups.aclust <- ACLUST(cups)
plot(cups.aclust)
# reproducing Figure 2(b) of Greenacre (2019) (unweighted parts))
# dataset Aar is in the compositions package
# aar is a subset of Aar
# code given here within the '\dontrun' environment since external package 'compositions' required
## Not run:
library(compositions)
data(Aar)
aar <- Aar[,c(3:12)]
aar.aclust <- ACLUST(aar, weight=FALSE)
# the maximum height is the total variance
# convert to percents of variance NOT explained
aar.aclust$height <- 100 * aar.aclust$height / max(aar.aclust$height)
plot(aar.aclust, main="Parts of Unexplained Variance", ylab="Variance (percent)")
## End(Not run)