View source: R/convert_ranks_to_pairwise.R
| convert_ranks_to_pairwise | R Documentation |
Converts a dataset of ranked forced-choice blocks into pairwise binary comparisons suitable for Thurstonian IRT modeling.
convert_ranks_to_pairwise(
data,
n_blocks,
block_size,
lower_rank_is_better = TRUE
)
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. |
A data frame of binary outcomes (1s, 0s, and NAs). The column names will match the "i1i2", "i1i3" format expected by the syntax generators.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.