get.data.from.response.TIRT: Convert TIRT Pairwise-Response Matrix to Forced-Choice Data...

View source: R/tools-data.R

get.data.from.response.TIRTR Documentation

Convert TIRT Pairwise-Response Matrix to Forced-Choice Data Strings

Description

Converts a Thurstonian IRT pairwise-response matrix back to the human-readable forced-choice strings used in data. This is the inverse of get.response.from.data.TIRT.

Usage

get.data.from.response.TIRT(
  response,
  block.items,
  fc.type = NULL,
  pairs.value = NULL
)

Arguments

response

An N \times P integer matrix of pairwise binary responses. Entries must be 1 (first item in the pair preferred) or 0 (second item in the pair preferred).

block.items

A list of length B giving the consecutive item labels in each forced-choice block.

fc.type

Character vector of length B (or a scalar recycled to all blocks): "RANK", "MOLE", or "PICK".

pairs.value

A list of length N, where each element is itself a list of length B giving the pair-definition matrix for each block. Required when any block uses "MOLE" or "PICK". For all-"RANK" data this argument may be omitted because the pair definitions are fixed by block.items.

Details

TIRT differs from the generic FC converters because the model is expressed through pairwise comparisons. The input response is therefore not a block-level pattern-index matrix. It is an N \times P binary matrix, where each column is one observed item pair and each entry is coded:

  • 1: the first item in that pair was preferred;

  • 0: the second item in that pair was preferred.

The number of response columns contributed by a block with K items is determined by fc.type:

RANK

All K(K-1)/2 unordered pairs are observed. Pair columns are generated in the order (1,2), (1,3), \dots, (K-1,K) using the item labels in block.items[[b]].

MOLE

Only the pairs needed to identify the most- and least-preferred items are retained. The block contributes 2K - 3 response columns per person.

PICK

Only the pairs involving the picked item are retained. The block contributes K - 1 response columns per person.

For "MOLE" and "PICK", the identities of the retained pairs can vary by person. The pairs.value object records those person-specific pair definitions and is required to reconstruct data strings without ambiguity. It is normally copied directly from the pairs.value component returned by get.response.from.data.TIRT.

TIRT conversion assumes consecutive item labels across blocks, for example list(1:2, 3:5). This is the layout returned by sim.data.TIRT.

Value

A data frame with N rows and B columns. Column names are "block.1", "block.2", etc. Cell values are character strings encoding the within-block ordering: full rankings for "RANK", "best>worst" for "MOLE", and single integers for "PICK".

See Also

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

get.data.from.response for the generic (non-TIRT) converter used by FCGGUM and FCMIRT.

Examples

# 2 RANK blocks: block 1 has items 1,2; block 2 has items 3,4,5.
items <- list(1:2, 3:5)
resp <- cbind(
  c(1, 0),            # block 1 pair: 1 vs 2
  c(1, 0),            # block 2 pair: 3 vs 4
  c(1, 0),            # block 2 pair: 3 vs 5
  c(1, 0)             # block 2 pair: 4 vs 5
)
get.data.from.response.TIRT(resp, items, fc.type = "RANK")

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