| get.data.from.response | R Documentation |
Converts an integer matrix of pattern indices back to human-readable forced-choice data strings. This is the generic converter used by FCGGUM, FCMIRT, and FCGDINA where each column of the response matrix is an index into the block's observed permutation-pattern list.
get.data.from.response(response, block.items, fc.type = "RANK")
response |
An |
block.items |
A list of length |
fc.type |
Character vector of length |
A data frame with N rows and B columns. Column
names are "block.1", ..., "block.B". Cell values
are character strings: full rankings ("2>5>8") for
"RANK", "best>worst" pairs for "MOLE", and
single integers for "PICK".
For a block with K items, the set of possible response patterns
depends on the forced-choice type:
All K! full permutations of the K items
are generated. The patterns are listed in lexicographic order
of the within-block item positions. For example, a 3-item
block with items c(2,5,8) produces 3! = 6 patterns:
(2,5,8), (2,8,5), (5,2,8), (5,8,2),
(8,2,5), (8,5,2). Pattern index 1 means the
first pattern was observed.
For a K-item block, K(K-1) most-least
observation patterns are possible: K choices for the most
preferred item times K-1 choices for the least preferred
item. Pattern (a,b) means item a was most
preferred and item b was least preferred.
For a K-item block, exactly K patterns
exist: one for each possible most-preferred item.
In all cases the pattern index (an integer from 1 to the number of
observed patterns) is the row number in the matrix returned by
the internal permutation helper for that block. The same deterministic
pattern construction is exposed by
generate_fc_permutation_patterns.
This format is a compact block-level encoding. One response column equals one forced-choice block, even when the block contains more than two items. This is the representation expected by the generic forced-choice model families FCGGUM, FCMIRT, and FCGDINA. It should not be confused with the TIRT pairwise format, where one block usually expands to several pair columns.
get.response.from.data for the reverse conversion.
generate_fc_permutation_patterns for pattern generation.
get.data.from.response.TIRT for the TIRT-specific
converter.
# 2 persons, 2 RANK blocks.
items <- list(1:2, 3:5)
resp <- cbind(c(1, 2), c(1, 6))
get.data.from.response(resp, items, fc.type = "RANK")
# Mixed block formats: first block is most-least, second block is pick.
mixed.items <- list(1:3, 4:6)
mixed.resp <- cbind(c(1, 6), c(1, 3))
get.data.from.response(
mixed.resp, mixed.items, fc.type = c("MOLE", "PICK")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.