make_calibration: Compute and Plot Calibration for Lineup Identification

View source: R/calibration_functions.R

make_calibrationR Documentation

Compute and Plot Calibration for Lineup Identification

Description

Main function to compute and plot calibration analysis for eyewitness lineup data.

Usage

make_calibration(
  data,
  confidence_bins = NULL,
  choosers_only = TRUE,
  lineup_size = 6,
  show_plot = TRUE,
  confidence_scale = c("auto", "0-1", "0-100"),
  innocent_suspect = "auto",
  population = NULL,
  tp_fillers = c("exclude", "error"),
  ...
)

Arguments

data

A dataframe with columns: target_present, identification, confidence

confidence_bins

Numeric vector of bin edges (optional)

choosers_only

Logical. If TRUE (default), suspect identifications are analysed; FALSE (deprecated) means population = "choosers". Ignored when population is supplied.

lineup_size

Integer. Number of people in lineup (default = 6)

show_plot

Logical. Whether to display the plot (default = TRUE)

confidence_scale

How the confidence scale is interpreted: "auto" (default), "0-1", or "0-100". See make_calibration_data.

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.

population

Which responses are calibrated: "suspect_ids" (suspect identifications, as in CAC analysis; correct when target-present), "choosers" (witnesses who identify someone; only target-present suspect IDs are correct; see tp_fillers), or "nonchoosers" (rejections; correct when target-absent). If NULL (default), it is set from choosers_only.

tp_fillers

For population = "choosers" only: how filler identifications in target-present lineups are treated. "exclude" (default) leaves them out, as Brewer and Wells (2006) did, because a filler is known in advance not to be the culprit. "error" keeps them as incorrect identifications; Brewer and Wells note that overconfidence is then more marked.

...

Additional arguments passed to make_calibration_gg()

Value

A list containing calibration data, statistics, and plot

Examples

set.seed(123)
n <- 200
lineup_data <- data.frame(
  target_present = rep(c(TRUE, FALSE), each = n / 2),
  identification = sample(c("suspect", "filler", "reject"), n,
                          replace = TRUE, prob = c(0.5, 0.25, 0.25)),
  confidence = round(runif(n, 0, 100))
)
cal_result <- make_calibration(lineup_data,
                               confidence_bins = c(0, 60, 80, 100))
print(cal_result)


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