29 Mar 2018 - Written by Dominique Makowski

Go to main menu.

Compute Signal Detection Theory Indices with R

Signal Detection Theory Indices (dprime, beta…)

Signal detection theory (SDT) is used when psychologists want to measure the way we make decisions under conditions of uncertainty. SDT assumes that the decision maker is not a passive receiver of information, but an active decision-maker who makes difficult perceptual judgments under conditions of uncertainty. To apply signal detection theory to a data set where stimuli were either present or absent, and the observer categorized each trial as having the stimulus present or absent, the trials are sorted into one of four categories: Hit, Miss, Correct Rejection and False Alarm.

*Anderson (2015)*

Based on the proportions of these types of trials, we can compute indices of sensitivity and response bias:

To compute them with psycho, simply run the following:

library(psycho)

# Let's simulate three participants with different results at a perceptual detection task
df <- data.frame(Participant = c("A", "B", "C"),
                 n_hit = c(1, 2, 5),
                 n_fa = c(1, 3, 5), 
                 n_miss = c(6, 8, 1),
                 n_cr = c(4, 8, 9))

indices <- psycho::dprime(df$n_hit, df$n_fa, df$n_miss, df$n_cr)
df <- cbind(df, indices)
Participant n_hit n_fa n_miss n_cr dprime beta aprime bppd c
A 1 1 6 4 -0.1925836 0.8518485 0.5000000 0.9459459 0.8326077
B 2 3 8 8 -0.1981923 0.8735807 0.4106061 0.8285714 0.6819377
C 5 5 1 9 0.9952151 0.8827453 0.5000000 -0.9230769 -0.1253182

Credits

This package helped you? You can cite psycho as follows:

Previous blogposts