View source: R/anri_functions.R
| bootstrap_anri | R Documentation |
Computes bootstrap confidence intervals around ANRI estimates using percentile method.
bootstrap_anri(
data,
confidence_bins,
choosers_only = TRUE,
lineup_size = 6,
n_bootstrap = 1000,
conf_level = 0.95,
seed = NULL,
confidence_scale = c("auto", "0-1", "0-100"),
innocent_suspect = "auto"
)
data |
Dataframe with standard lineup format |
confidence_bins |
Numeric vector of bin edges |
choosers_only |
Logical. If |
lineup_size |
Integer. Lineup size (default = 6) |
n_bootstrap |
Integer. Number of bootstrap replications (default = 1000) |
conf_level |
Numeric. Confidence level for CIs (default = 0.95) |
seed |
Integer. Random seed for reproducibility (default = NULL) |
confidence_scale |
How the confidence scale is interpreted: "auto" (default),
"0-1", or "0-100". See |
innocent_suspect |
How innocent-suspect identifications in
target-absent lineups are obtained. |
Bootstrap resampling procedure: 1. Resample lineups with replacement, separately within the target-present and target-absent lineups, so both totals stay fixed 2. Compute ANRI for each bootstrap sample 3. Construct percentile-based confidence interval
The percentile method uses the empirical quantiles of the bootstrap distribution. For a 95
A list containing:
anri: Point estimate of ANRI
nri: Point estimate of NRI
ci_lower: Lower bound of bootstrap CI
ci_upper: Upper bound of bootstrap CI
conf_level: Confidence level used
n_bootstrap: Number of bootstrap replications
bootstrap_distribution: Vector of bootstrap ANRI values
Efron, B., & Tibshirani, R. J. (1994). An Introduction to the Bootstrap. Chapman & Hall/CRC.
set.seed(123)
n <- 200
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))
)
boot_result <- bootstrap_anri(data, confidence_bins = seq(0, 100, 20),
n_bootstrap = 200, seed = 1)
c(boot_result$ci_lower, boot_result$ci_upper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.