Tuesday, October 16, 2007

SDT Analysis in SPSS

This evening I was trying to figure out how to run signal detection analysis (SDT) using SPSS, rather than having to caculate SDT parameters (e.g., d') in Excel first and then do the statistical analysis in SPSS. Not that I have any concern about the accuracy of the output from Excel. I just don't trust myself to be able to calculate everything manually in Excel and not making a single mistake the entire time (even if I can do it once in a while, I don't think I can finish the process without any mistake everytime). I decided that if I can figure out how to calculate the SDT parameters in SPSS, it would greatly improve the accuracy of the analysis, and reduce the time needed to conduct the analysis and double check the accuracy.

The calculation of d' is pretty straight forward in theory. It's given by the distance between the center of the hypothesized distributions of signal and no signal (noise), divided by the spread of the distributions. This could then be further translated into this formula: d' = z(hit) - z(false alarm).

The main problem I encountered was that even though I know how to calculate the inversed culmulative normal distribution in in Excel (given by the function NORMSINV), I don't know how to do the same thing in SPSS. I tried google "sdt analysis in spss," "how to calculate d prime in spss," ... etc but didn't really find what I needed. Then I googled "NORMSINV equivalent in spss" and I came across this following document:

http://www.stat.auckland.ac.nz/~leila/07S2_SPSS_Excel_Workshop_II.pdf

Luckily this document is exactly what I was looking for: it introduces how to calculate culmulative normal districution functions in SPSS AND in Excel. To calculate d' and other SDT parameters in SPSS, you can use the following syntax (these are specifically for 2AFC tasks):

===================================
COMPUTE dprime = (IDF.NORMAL(HitRate,0,1) - IDF.NORMAL(FArate,0,1))/SQRT(2) .
EXECUTE .
COMPUTE c = -.5*(IDF.NORMAL(HitRate,0,1) + IDF.NORMAL(FArate,0,1)) .
EXECUTE .
COMPUTE cprime = c/(IDF.NORMAL(HitRate,0,1) - IDF.NORMAL(FArate,0,1)) .
EXECUTE .
===================================

In the context of a 2AFC task (let's say stimulus A and stimulus B), HitRate refers to the probablity of responding A when A is presented, and FArate refers to the probability of responding A when B is presented.

Because I started with the trial by trial data in the analysis, I had to aggregate and restructure the data several times in order to calculate the SDT parameters and then run the repeated measures ANOVA. However, once the syntax file is set up, if I want to run the same analysis again, all I need to do is change the file names that get retrieved and saved in the syntax, and then click on the run all icon. Then the entire analysis could be done within seconds :)

Labels: ,

2 Comments:

Blogger Amir Hamja said...

thanks for good post.

6:25 PM  
Blogger Josephus P. Franks said...

Quick question: what does the addition of "/SQRT(2)." do? I've seen other people write about performing SDT analysis in SPSS, and they leave out this part of the formula... Might you explain a bit?
Thanks in advance!

1:17 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home