Learn R Programming

cata (version 0.1.0.27)

barray: Convert 3d array of CATA data to 4d array of CATA differences

Description

Converts a three-dimensional array (\(I\) assessors, \(J\) products, \(M\) attributes) to a four-dimensional array of product comparisons (\(I\) assessors, \(J(J-1)/2\) product comparisons, two outcomes (of type b or c), \(M\) attributes)

Usage

barray(X, values = "bc", type.in = "binary", type.out = "binary")

Value

A four-dimensional array of product comparisons having \(I\)

assessors, \(J(J-1)/2\) product comparisons, outcomes (see values

parameter), \(M\) attributes

Arguments

X

three-dimensional array (\(I\) assessors, \(J\) products, \(M\) attributes) where values are 0 (not checked) or 1 (checked)

values

"bc" (default) returns two outcomes: b and c; otherwise "abcd" returns four outcomes: a, b, c, d.

type.in

type of data submitted; default (binary) may be set to ordinal or scale.

type.out

currently only binary is implemented

Author

J.C. Castura

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. tools:::Rd_expr_doi("10.1016/j.foodqual.2022.104564").

Examples

Run this code
data(bread)

# Get the 4d array of CATA differences for the first 8 consumers
b <- barray(bread$cata[1:8,,])

Run the code above in your browser using DataLab