neuropsychology.R icon indicating copy to clipboard operation
neuropsychology.R copied to clipboard

dprime not calculating correctly

Open quekles opened this issue 5 years ago • 1 comments

I think there might be a bug in the calculation of dprime in the dprime function. This function adjusts for extreme values (e.g., n_miss = 0) using the Hautus (1995) correction, which is summarised as:

"A method that has found much use in log-linear analysis requires the addition of 0.5 to each cell in the two-by-two contingency table that defines the performance of the observer (e.g., Fienberg, 1980; Goodman, 1970; Knoke & Burke, 1980). Row and column totals are increased by one." Hautus (1995, pg. 46).

dprime performs this adjustment in the following way:

hit_rate_adjusted <- (n_hit + 0.5)/((n_hit + 0.5) + n_miss + 1)
fa_rate_adjusted <- (n_fa + 0.5)/((n_fa + 0.5) + n_cr + 1)
dprime <- qnorm(hit_rate_adjusted) - qnorm(fa_rate_adjusted)

But if I'm not mistaken, this is adding 1.5 to the row/col totals, when it should only be adding 1.

quekles avatar Mar 19 '19 14:03 quekles

Dear @quekles, thanks for digging in the code :)

Unfortunately, neuropsychology has been deprecated in favour of psycho.

However, it seems that this code is still present in the new version, as it was taken from another source (can't remember the name of the paper). How would you suggest the change should be made?

DominiqueMakowski avatar Mar 19 '19 14:03 DominiqueMakowski