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 I assessors, J products, M attributes where CATA data have values 0 (not checked) and 1 (checked)

inspect

default (TRUE) calls the inspect function to evaluate all solutions (when runs>1)

inspect.plot

default (TRUE) plots results from the inspect function

algorithm

default is n for non-hierarchical; h for hierarchical

measure

default is b for the b-measure; Q for Cochran's Q test

G

number of clusters (required for non-hierarchical algorithm)

M

initial cluster memberships

max.iter

maximum number of iteration allowed (default 500)

X.input

available only for non-hierarchical algorithm; its value is either "data" (default) or "bc" if X is obtained from the function barray

tol

non-hierarchical algorithm stops if variance over 5 iterations is less than tol (default: exp(-32))

runs

number of runs (defaults to 1)

seed

for reproducibility (default is 2021)

Value

list with elements:

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)

[Package cata version 0.1.0.6 Index]