Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Best-worst scaling design, scoring and choice probability function

(B_i, W_i, V_j) -> (S_i, P(b, w | C))

Maps a planned series of choice sets, each answered with a best and a worst choice, to a scale of preference or priority. The design is usually a balanced incomplete block design, the simplest analysis counts best and worst choices and standardises their difference, and choice models place items on a latent utility scale through the probability of each best and worst pair. The notation follows the Best-Worst Scaling article.

  • Balanced incomplete block design parameters for object case best-worst scaling

    r = b * k / v; lambda = r * (k - 1) / (v - 1)

    Gives the number of times each object appears and the number of times each pair of objects appears together in a balanced incomplete block design with v objects shown in b sets of k. The first identity counts object appearances two ways, b times k equals v times r; the second counts one object's pairings two ways, lambda times (v minus 1) equals r times (k minus 1). Whole-number values of r and lambda are needed for such a design.

  • Standardised best-minus-worst score in object case best-worst scaling

    S_i = (B_i - W_i) / (N * r_i)

    Divides the difference between the number of times an item was chosen best and the number of times it was chosen worst by the number of times it could have been chosen: the number of respondents times its appearances in each respondent's design. Scores run from minus 1, always worst, to plus 1, always best, and across all items the differences sum to zero.

  • Maxdiff model probability of a best and worst pair in one choice set

    P_max = exp(V_b - V_w) / (S_pos * S_neg - J)

    Gives the probability that item b is chosen best and item w worst from a set of J items when the respondent picks, from all ordered pairs of distinct items, the pair with the largest utility difference. The denominator is the sum of exp(V_j minus V_k) over all J(J minus 1) ordered pairs with j not equal to k, which equals S_pos times S_neg minus J, where S_pos sums exp(V_j) and S_neg sums exp(minus V_j) over the set; the J terms with j equal to k each equal 1. The probabilities over all ordered pairs sum to 1.

  • Sequential best-then-worst model probability in one choice set

    P_seq = exp(V_b) / S_pos * exp(-V_w) / (S_neg - exp(-V_b))

    Treats the best choice as a logit choice from the whole set and the worst choice as a logit choice on minus the utilities from the items left once the best is removed, and multiplies the two. S_neg minus exp(minus V_b) is the sum of exp(minus V_k) over the set without item b. From the same utilities it gives different probabilities from the maxdiff model (HE-FM-BWS-003), so a study should state which it assumed.