vocabulary2CT {DistatisR}R Documentation

Transforms a data.frame of products by vocabulary of assessors into a products by words (from vocabulary) contingency table.

Description

vocabulary2CT Transforms a data.frame of products by vocabulary of assessors into 1) a cube of 0/1 contingency tables (one per assessor); and 2) a products by words (from vocabulary) contingency table. In this contingency table, the number at the intersection of a row (product) and a column (word) is the number of assessors who used this word to describe that product.

@details the cube of 0/1 contingency tables (i.e., cubeOfVocabulary can also be analyzed with the package PTCA4CATA as a pseudo Check All That Apply (CATA) data set.

Usage

vocabulary2CT(df.voc)

Arguments

df.voc

a data frame with the vocabulary. In this data.frame each element stores the words used by one assessor to describe a product (words are separated with spaces);

Value

a list with 1) cubeOfVocabulary: a 0/1 array of dimension products by words (from the vocabulary) by assessors where each "products by vocabulary" slice gives the vocabulary chosen by the assessor to describe the products; and 2) CT.vocabulary a matrix storing the products by words contingency table.

Author(s)

Herve Abdi

See Also

unnest_tokens count BeersProjectiveMapping

Examples


# Get the BeersProjectiveMapping example
data("BeersProjectiveMapping")
aContingenyTable <- vocabulary2CT(BeersProjectiveMapping$Vocabulary)


[Package DistatisR version 1.1.1 Index]