make_ydif_from_bw: Make Best-Worst Pair Indices from Best and Worst Responses

View source: R/wrapper_mdu.R

make_ydif_from_bwR Documentation

Make Best-Worst Pair Indices from Best and Worst Responses

Description

Converts separate 'Best' and 'Worst' response matrices into 'Y_dif' pair indices for Best-Worst MDU models. The returned index is the position of the ordered '(best, worst)' pair among all 'C * (C - 1)' position pairs generated from each row of 'sets'.

Usage

make_ydif_from_bw(Best, Worst, sets)

Arguments

Best

Matrix or data frame of best responses (N persons x P tasks). Values must be positions within the corresponding row of 'sets', from '1' to 'ncol(sets)'.

Worst

Matrix or data frame of worst responses (N persons x P tasks). Values must be positions within the corresponding row of 'sets', from '1' to 'ncol(sets)'.

sets

Matrix or data frame of presented item sets (P tasks x C items).

Value

An integer matrix of pair indices ('Y_dif').


BayesRTMB documentation built on Nov. 24, 2026, 9:06 a.m.