dprime: d-prime

Description Usage Arguments Value Examples

View source: R/sdt.R

Description

Calculate the d' statistic using the hit and false alarm rate to stimuli from the target and lure distribution, respectively.

Usage

1
dprime(targets, lures, correct = FALSE)

Arguments

targets

A logical vector of yes (TRUE)/no (FALSE) responses to stimili from the target (S1) distribution. Used to calculate the Hit Rate.

lures

logical vector of yes (TRUE)/no (FALSE) responses to stimili from the lure (S0) distribution. Used to calculate the False Alarm Rate.

correct

If true, the 1/2n correction is applied for all yes or all no responses so that the dprime statistic is not Inf or NaN after the z-transform is applied to the Hit and False Alarm Rates

Value

A scalar numeric vector

Examples

1
2
3
dprime(c(0,0,1,1), c(1,0,0,0))
dprime(c(0,0,0,0), c(0,0,0,0), correct = TRUE)
dprime(c(0,0,0,0), c(0,0,0,0)) # NaN

wjhopper/whoppeR documentation built on May 4, 2019, 7:33 a.m.