Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dprime not calculating correctly #10

Open
quekles opened this issue Mar 19, 2019 · 1 comment
Open

dprime not calculating correctly #10

quekles opened this issue Mar 19, 2019 · 1 comment

Comments

@quekles
Copy link

quekles commented Mar 19, 2019

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.

@DominiqueMakowski
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants