Current version: 2.3, August 2003
August 2003: Made the output more flexible. It will now nicely adjust to long names of conditions or files.
April 2003: Finally implemented vincentizing. The -q X option will do the job (see the command line reference).
January 2003: I added a feature that makes it possible to get a file
containing the distributions of your RT data. See the
option in the command line reference.
RS: Reaction time data analysis
What do you do to analyze reaction time data? You've got a couple of files that your experimental program gave you, and then what? You could feed them into SPSS or some other statistics program. But this is quite cumbersome, and it sure isn't fast. I created my own analysis program, and it sure is fast and has exactly the features I need. I called it RS for RT statistics. But the most important point in naming it was the shortness of the name. RS has only two letters, and I tend to be lazy and prefer not to type too much.
RS will read a set of files, each containing the data of one subject. It will then compute the median, mean, standard deviation, error rate, arcsine-transformed error rate and number of included trials for each subject and each condition. And the average of each of these measures for each condition. These are all written to one file. You can also request separate files for the medians and the arcsine-transformed error-rate to feed these into your statistics program. Furthermore you can request the quantiles of the RT distributions or the distribution itself.
To run the compiled binary, you need a DOS based operating system, like DOS, or some variant of MS-Windows. If you have a compiler, you can download the C++ source code, compile that and then use any system you like. Your data should be stored in ASCII text files, that are organized in rows and columns:
Each row should represent one experimental trial. The columns can contain whatever you want, but they should at least contain three parameters:
- The reaction time of the current trial. Either in milliseconds or in fractions of a second (e.g. 300 or 0.3).
- A type code. As a means to group the trials according to your experimental factors/conditions.
- A correctness indicator. One column should indicate whether the subject's response was correct, i.e. wheter the required button was pressed.
You can download the precompiled binary (109 kb) along with an example ini file. But you can also download the sources (26 kb). The sources contain the source files (C++), that should compile with every standard compliant C++ compiler, along with a make file for DJGPP (gcc) and a project file for MS-VC 6.
Suppose you conducted a simple flanker experiment, according to Eriksen. You used compatible, incompatible and neutral flankers, so you have three experimental conditions. Subjects had to press button 1 when the Target was the letter S and button 2 when the target was the letter H. You presented the flanker-target array above or below fixation.
Thus, you could come up with 4 codes for each experimental condition: "1" could be compatible flankers, above fixation, requiring response 1. "2": compatible, below fixation, response 1, etc. In this way the compatible condition would be made up of the codes 1-4, the incompatible of 5-8, and the neutral of 9-12.
Of course, you also need information about the correctness of the responses. The simplest form to implement this would be a column that contains a "1" if the response was correct and a "0" if the wrong button was pressed.
Each subject's data ends up in one file, organized in four columns: Trial number, type code, correctness, and reaction time:
1 4 1 370 2 9 1 433 ... 399 12 1 390 400 5 0 354
The ini file
We now need a way to tell RS what to do and where to look for the data. A simple ini-file is used for that purpose. It's a little ascii file with the default name "RS.INI". And it looks like that:
4 Column with RT 2 Column with type code 3 Column of the first parameter 8 Column of the second parameter (exclusion... 100 Minimal RT (in milliseconds) 1000 Maximal RT Conditions: Name Codes valid Values for ; 1. parm; 2. parm; correction value comp 1 2 3 4 ; 1 ; ; incomp 5 6 7 8 ; 1 ; ; neut 9 _ 12 ; 1 ; ;
The first 4 lines tell RS which values are stored in which column: RTs can be found in column 4, type codes in column 2, the first paramter (correctness) in column 3. We aren't using the second parameter, thus we have some bogus number here.
The next two lines are self-explanatory. Use them to exclude anticipatory reactions and trials in which the subject was asleep.
Next, we have the definitions for our three experimental conditions. The number of conditions is obvious for RS: Each line with a name and three semicolons constitutes one condition. First in each of these lines is the name of the condition. Next are the type codes that belong to that condition. You can either enumerate them, like I did for the compatible and incompatible condition, or indicate a range, using the underscore (_). You can also combine the two like in "1 4 6 _ 10".
RS will read as many type codes as it finds before the first semicolon. Thus the semicolons are essential to seperate the fields. The correctness indicator has it's place after the first semicolon. You are not restricted to one code here, but I tried to keep the example simple. Since we are not using the second parameter and the correction value, there is nothing behind the second and third semicolon.
With the ini file set up, we can now start RS. 2 seconds later the results
should be waiting for you to inspect them. Suppose you named the data
"RT.1" for subject 1,
"RT.2" for subject 2, etc.
You can give a wildcard mask or a list of file names to RS:
This is the simplest way to call RS. RS will first look for its ini file, RS.INI, and read it. It will then read every file that fits the mask, compute all the measures and then write them to a file called RESULTS.RT. This file will contain:
- The number of subjects (files read) and the number of conditions.
- A section with the medians for each subject (rows) and each condition (columns).
- A section with the means and standard deviations for each subject and condition.
- A section with the frequencies of valid responses, the error frequency, and the error rate for each subject and condition.
- A section with the arcsine-transformed error rates.
- A matrix with the differences of the average medians.
- A section with the results across subjects, containing the average medians, the average means, and the average error rate for each condition.
You will have noticed two "sleeping" features in the example ini file: The second parameter gives you the opportunity to exclude trials that match a certain condition. These trials will not be considered errors, RS will simply discard them. You could use them for trials, in which the subject did not give any response, e.g. The correction value can be used to add a fixed number to any reaction time. You can thus influence the the point of 0 ms post-stimulus.
Calling RS can be done with a couple of command line arguments, that influence what RS will do:
-o namewill redirect the results to a file
"name", instead of
-i namewill make RS look for an ini file called
-m [name]will order RS to write a separate file containing only the medians, named
nameif you provide a name
-e [name]will make RS write a separate file with the arcsine-transformed error rates (
nameif you provide a name)
-ais short for
-q Xwill produce a file called
"QUANT.DAT", containing the vincentized (Vincent, 1912; Ratcliff, 1979) quantiles of the RT distributions, e.g.
-q 10will give you deciles for each subject and condition. At the end of the resulting file
"QUANT.DAT", you will find the averages of these data, i.e. one line per condition and X columns.
-f Xwill produce a file called
"DISTR.DAT"which will contain the RT distribution. RTs are grouped into bins of width X. The first bin starts with the minimum RT value you specified in the ini file. The total number of bins depends on the value of X and the maximum value for any RT as specified in the ini file. The values in
"DISTR.DAT"are percentages. For each subject and each condition the RT values for each bin are counted. The result is divided by the total number of correct trials per subject and condition and multiplied by 100. The file will contain one line per condition for each subject. The values of the subjects are divided by empty lines. The end of the file will contain and average per condition. The columns, of course, contain the values of the bins.
-c Xwill produce the file
"KUMUL.DAT"as its output. It works just like the
-foption, but you will get the values of the cumulative distribution.
-dwill write debug information to
"rs_debug.txt". This maybe useful if you cannot get your ini file to work as expected.
-? or -hwill give you a list of possible options.
I use RS to do all my analyses of reaction time data. It never crashed and all the tests I conducted give me the impression that the results are correct. Now and then I notice a missing feature or a way to make the output more readable or useful. If you find a bug or if you would like to see an option added to RS, just send me an email (email@example.com) and I will see what I can do. Of course, any other sorts of comments, questions, etc. are also very, very welcome! I'm very interested in any kind of feedback. Let me know what you think.