| sdt_compare | R Documentation |
Computes a Bayesian posterior distribution for the difference
\Delta d' = d'_A - d'_B using independent Beta posteriors (Jeffreys
prior by default) for the hit and false-alarm rates in each condition.
sdt_compare(
hits_A,
misses_A,
fas_A,
crs_A,
hits_B,
misses_B,
fas_B,
crs_B,
label_A = "A",
label_B = "B",
alpha = 0.5,
S = 10000,
credible_mass = 0.95
)
hits_A, misses_A, fas_A, crs_A |
Integer counts for condition A. |
hits_B, misses_B, fas_B, crs_B |
Integer counts for condition B. |
label_A, label_B |
Character labels for conditions (default "A", "B"). |
alpha |
Prior concentration for the Beta prior on each rate.
Default 0.5 (Jeffreys). Named shortcuts: |
S |
Number of posterior draws. Default 10000. |
credible_mass |
Width of the equal-tailed credible interval. Default 0.95. |
For lineup data, a hit is a correct identification of the culprit in a
target-present lineup and a false alarm is an identification of the designated
innocent suspect in a target-absent lineup; filler identifications and
rejections are misses and correct rejections. The d' is then a yes/no
analogue, an approximation that ignores which lineup member was chosen (see
vignette("sdt_summary_comparisons")).
Independent Jeffreys Beta posteriors are placed on the hit and false-alarm rates in each condition:
HR_A \mid \mathbf{n} \sim \mathrm{Beta}(\text{hits}_A + \alpha,\; \text{misses}_A + \alpha)
FAR_A \mid \mathbf{n} \sim \mathrm{Beta}(\text{fas}_A + \alpha,\; \text{crs}_A + \alpha)
The posterior d' draws are:
d'^{(s)}_A = \Phi^{-1}(HR_A^{(s)}) - \Phi^{-1}(FAR_A^{(s)})
and analogously for B. The posterior of the difference is
\Delta d'^{(s)} = d'^{(s)}_A - d'^{(s)}_B, from which
P(d'_A > d'_B \mid \mathbf{n}) is directly read off.
The Jeffreys prior (\alpha = 0.5) handles zero cell counts gracefully
and provides direct probability statements - unlike the asymptotic z-test in
compare_sdt_summary.
An object of class "sdt_compare" containing:
Posterior draws of \Delta d'.
Per-condition d' draws.
Posterior summaries of \Delta d'.
Named lower/upper CI on \Delta d'.
Posterior probability that d'_A > d'_B.
Posterior probability that d'_B > d'_A.
Posterior means of each d'.
Output of compare_sdt_summary() for comparison.
Metadata.
Macmillan, N. A., & Creelman, C. D. (2005). Detection Theory: A User's Guide (2nd ed.). Lawrence Erlbaum.
Wixted, J. T., & Mickes, L. (2014). A signal-detection-based diagnostic-feature detection model of eyewitness identification. Psychological Review, 121(2), 262-276.
compare_sdt_summary, sdt_summary_from_counts,
diag_ratio_T_bayes
# Simultaneous vs. sequential lineup comparison. The counts are illustrative,
# and d' from collapsed counts is a yes/no analogue, an approximation for
# lineups (hits and false alarms defined as in the description).
res <- sdt_compare(
hits_A = 45, misses_A = 55, fas_A = 12, crs_A = 88,
hits_B = 38, misses_B = 62, fas_B = 10, crs_B = 90,
label_A = "Simultaneous", label_B = "Sequential"
)
print(res)
plot(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.