| get.block.items.from.data.FCDCM | R Documentation |
Recovers the two-item composition of each FCDCM block from a character
data matrix of "a>b" / "b>a" preference strings. Because
every FCDCM block always compares exactly two statements, this function
only needs to inspect the first non-missing row of each column.
get.block.items.from.data.FCDCM(data)
data |
An |
The returned item pair is sorted in ascending order. For example, both
"1>3" and "3>1" imply c(1L, 3L) for that block. This
sorted pair is then the default coding direction used by
get.response.from.data.FCDCM: response value 1 means the
first element of the pair was preferred, and response value 0 means the
second element was preferred.
This helper assumes the two compared statements are fixed within each column. If a column accidentally mixes different item pairs, only the first parseable non-missing cell determines the returned pair, so such data should be cleaned before conversion.
A list of length B. Each element is a two-element integer
vector c(a, b) with a < b.
get.block.items.from.data for the generic multi-item
variant used by FCGGUM, FCMIRT, and TIRT.
get.response.from.data.FCDCM to convert FCDCM data strings
to a 0/1 response matrix.
dat <- data.frame(
b1 = c("1>3", "3>1", "1>3"),
b2 = c("2>4", "2>4", "4>2"),
stringsAsFactors = FALSE
)
get.block.items.from.data.FCDCM(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.