| get.data.from.response.FCDCM | R Documentation |
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.
get.data.from.response.FCDCM(response, block.items)
response |
An |
block.items |
A list of length |
A data frame with N rows and B columns. Each
cell is a character string "a>b" or "b>a".
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.
get.response.from.data.FCDCM for the reverse
conversion.
get.data.from.response for the generic multi-item
converter.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.