convert_ranks_to_pairwise: Convert Ranked Blocks into Pairwise Binary Outcomes

View source: R/convert_ranks_to_pairwise.R

convert_ranks_to_pairwiseR Documentation

Convert Ranked Blocks into Pairwise Binary Outcomes

Description

Converts a dataset of ranked forced-choice blocks into pairwise binary comparisons suitable for Thurstonian IRT modeling.

Usage

convert_ranks_to_pairwise(
  data,
  n_blocks,
  block_size,
  lower_rank_is_better = TRUE
)

Arguments

data

A data frame or matrix where rows are respondents and columns are items. The columns must be ordered by block (e.g., Block 1 Item 1, Block 1 Item 2, Block 1 Item 3, Block 2 Item 1, etc.). Each column represents the assigned rank of that corresponding item in the block.

n_blocks

Integer. Number of blocks in the questionnaire.

block_size

Integer. Number of items per block.

lower_rank_is_better

Logical. In your data, does a smaller number mean a higher preference? (e.g., 1 = Most Preferred, 2 = Second Most). Defaults to TRUE.

Value

A data frame of binary outcomes (1s, 0s, and NAs). The column names will match the "i1i2", "i1i3" format expected by the syntax generators.


autoFC documentation built on July 14, 2026, 5:07 p.m.