make_utility_difference: Compute Utility Difference Curves Comparing Two Procedures

View source: R/utility_functions.R

make_utility_differenceR Documentation

Compute Utility Difference Curves Comparing Two Procedures

Description

Computes the difference in expected utility between two lineup procedures across a range of base rates and/or utility matrices, following Lampinen, Smith, & Wells (2019).

Usage

make_utility_difference(
  data_proc_a,
  data_proc_b,
  base_rate_grid = seq(0.01, 0.99, 0.01),
  utility_matrix = c(tp = 1, fn = -0.5, fp = -2, tn = 0.5),
  utility_type = c("max", "avg", "all"),
  lineup_size = 6,
  innocent_suspect = "auto"
)

Arguments

data_proc_a

A dataframe for procedure A (standard lineup format)

data_proc_b

A dataframe for procedure B (standard lineup format)

base_rate_grid

Numeric vector of base rates to evaluate. Default: seq(0.01, 0.99, 0.01)

utility_matrix

Named numeric vector with utilities (tp, fn, fp, tn). Default: c(tp=1, fn=-0.5, fp=-2, tn=0.5)

utility_type

Character. Which utility to compare:

  • "max": Maximum utility (optimal criterion)

  • "avg": Average utility across all criteria

  • "all": Utility of accepting all identifications

Default = "max".

lineup_size

Integer. Lineup size (default = 6)

innocent_suspect

How innocent-suspect identifications in target-absent lineups are obtained. "designated": the lineups had a designated innocent suspect, so target-absent "suspect" rows are counted directly, and zero such rows means a false-ID rate of zero. "estimated": there was no designated innocent suspect, so the innocent-suspect count is estimated as filler IDs divided by lineup_size. "auto" (the default) chooses "designated" when any target-absent row is a suspect ID or the data have a non-missing suspect_pos column, and "estimated" otherwise, with a message.

Details

Utility difference curves show how the relative value of two procedures changes with the base rate (prevalence) of guilty suspects. This addresses the question: "Which procedure is better, and does it depend on the base rate?"

Utility Difference = EU_A - EU_B

Interpretation:

  • Positive difference: Procedure A has higher utility (preferred)

  • Negative difference: Procedure B has higher utility (preferred)

  • Zero difference: Procedures equivalent at that base rate

Lampinen et al. (2019) show that ROC dominance does not guarantee utility dominance in general. Dominance holds only over the false-identification range that both curves reach: if the dominating curve is less truncated than the dominated one, its maximum utility is necessarily higher, but when it stops short of the other curve's optimum, or for utilities other than the maximum (average or high-confidence utility), a procedure with a lower pAUC can have the higher utility at some base rates and cost structures.

Value

A list containing:

  • difference_curve: Dataframe with base_rate, eu_a, eu_b, and difference

  • utility_type: Type of utility compared

  • utility_matrix: Utility matrix used

  • crossover_points: Base rates where procedures have equal utility (if any)

References

Lampinen, J. M., Smith, A. M., & Wells, G. L. (2019). Four utilities in eyewitness identification practice: Dissociations between receiver operating characteristic analysis and expected utility analysis. Law and Human Behavior, 43(1), 26-44.

Examples


data(lineup_example)
odd <- seq(1, nrow(lineup_example), by = 2)
util_diff <- make_utility_difference(lineup_example[odd, ],
                                     lineup_example[-odd, ],
                                     base_rate_grid = seq(0.1, 0.9, 0.1))
util_diff$difference_curve



r4lineups documentation built on Nov. 10, 2026, 1:08 a.m.