View source: R/utility_functions.R
| make_utility_difference | R Documentation |
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).
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"
)
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:
Default = "max". |
lineup_size |
Integer. Lineup size (default = 6) |
innocent_suspect |
How innocent-suspect identifications in
target-absent lineups are obtained. |
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.
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)
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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.