bcluster {cata} | R Documentation |
Wrapper function for b-cluster analysis
Description
By default, bcluster
calls a function to perform b-cluster analysis
by a non-hierarchical iterative ascent algorithm, then inspects results if
there are multiple runs.
Usage
bcluster(X, inspect = TRUE, inspect.plot = TRUE, algorithm = "n",
measure = "b", G = NULL, M = NULL, max.iter = 500, X.input = "data",
tol = exp(-32), runs = 1, seed = 2021)
Arguments
X |
three-way array with |
inspect |
default ( |
inspect.plot |
default ( |
algorithm |
default is |
measure |
default is |
G |
number of clusters (required for non-hierarchical algorithm) |
M |
initial cluster memberships |
max.iter |
maximum number of iteration allowed (default |
X.input |
available only for non-hierarchical algorithm; its value is
either |
tol |
non-hierarchical algorithm stops if variance over 5 iterations is
less than |
runs |
number of runs (defaults to |
seed |
for reproducibility (default is |
Value
list with elements:
runs
: b-cluster analysis results frombcluster.n
orbcluster.h
(in a list ifruns>1
)inspect
: result frominspect
(the plot from this function is rendered ifinspect.plot
isTRUE
)
References
Castura, J.C., Meyners, M., Varela, P., & Næs, T. (2022). Clustering consumers based on product discrimination in check-all-that-apply (CATA) data. Food Quality and Preference, 104564. doi:10.1016/j.foodqual.2022.104564.
Examples
data(bread)
# b-cluster analysis on the first 8 consumers and the first 5 attributes
(b1 <- bcluster(bread$cata[1:8,,1:5], G=2, seed = 123))
# Since the seed is the same, the result will be identical to
# (b2 <- bcluster.n(bread$cata[1:8,,1:5], G=2, seed = 123))
b3 <- bcluster(bread$cata[1:8,,1:5], G=2, runs = 5, seed = 123)