get.data.from.response.FCDCM: Convert an FCDCM Response Matrix to FC Data Strings

View source: R/tools-data.R

get.data.from.response.FCDCMR Documentation

Convert an FCDCM Response Matrix to FC Data Strings

Description

Converts a binary FCDCM response matrix (0/1 or 1/2 coding) back to human-readable "a>b" / "b>a" preference strings. Each block compares exactly two items; the response indicates which item was selected.

Usage

get.data.from.response.FCDCM(response, block.items)

Arguments

response

An N \times B integer matrix coded as 0/1 or 1/2, where B is the number of FCDCM blocks.

block.items

A list of length B. Each element is an integer vector of length 2 giving the two global statement indices compared in that block.

Value

A data frame with N rows and B columns. Each cell is a character string "a>b" or "b>a".

Response Coding

Two coding conventions are accepted:

  • 0/1 coding: 1 means the first-named item in block.items was preferred; 0 means the second-named item was preferred.

  • 1/2 coding: 1 means the first-named item; 2 means the second-named item. This is auto-detected and converted.

The output always uses "a>b" format where a and b are the two item indices in the comparison order.

The direction is controlled by block.items. If block.items[[1]] = c(1L, 3L), then response value 1 becomes "1>3" and response value 0 becomes "3>1". With 1/2 coding, value 1 has the same meaning as above and value 2 means the second item. A response matrix must use one coding convention consistently; mixed 0/1/2 values are rejected.

See Also

get.response.from.data.FCDCM for the reverse conversion.

get.data.from.response for the generic multi-item converter.

Examples

items <- list(c(1L, 3L), c(2L, 4L))
resp <- cbind(c(1, 0, 1), c(0, 1, 1))
dat <- get.data.from.response.FCDCM(resp, items)
dat
get.response.from.data.FCDCM(dat, items)$response

# The same preferences can also be supplied as 1/2 responses.
resp12 <- cbind(c(1, 2, 1), c(2, 1, 1))
get.data.from.response.FCDCM(resp12, items)

ForceChoice documentation built on Sept. 13, 2026, 1:06 a.m.