Introduction
The Stroop Task is one of the best known psychological experiments named after John Ridley Stroop. The Stroop phenomenon demonstrates that it is difficult to name the ink color of a color word if there is a mismatch between ink color and word. For example, the word GREEN printed in red ink. The wikipedia web site gives a good description of the effect.
Colin MacLeod’s (1991) review article in the influential psychological journal Psychological Bulletin is frequently cited when discussing the effect.
There are many variations on the basic effect using other stimuli than colored words.
It is easier to measure key presses than the time it takes to name a task; therefore, there are "manual" Stroop tasks in which you need to press colored keys.
About this implementation
-
The demo takes less than 2 minutes to complete.
-
The demo below requires button presses instead of just naming (as in the original study)
-
In the demo, there are only 40 trials. In a real experiment, you should use considerably more trials to have a more reliable measure of the Stroop effect.
-
At the end of the demo, you get feedback about your response times in the compatible and incompatible condition:
-
Compatible: The color of the word and the meaning is the same (e.g., GREEN)
-
Incompatible: The color of the word and the meaning is different (e.g., GREEN)
-
-
The Stroop effect is here reported as the average response time in incompatible trials minus compatible trials.
-
Note, you can show your response times and copy and paste them to a local file for your own data analysis.
Run the demo
In this example, you will see colored words (like GREEN, or BLUE). You need to respond to the color of the words (not the meaning) by pressing the corresponding key (r,g,b,y for red, green, blue, and yellow stimuli). |
Data output file
In PsyToolkit, the data output file is simply a textfile. The save line of the PsyToolkit experiment script determines what is being saved in the data output file. Typically, for each experimental trial, you would have exactly one line in your text file, and each number/word on that line gives you the information you need for your data analysis, such as the condition, response speed, and whether an error was made. |
Meaning of the columns in the output datafile. You need this information for your data analysis.
Colum | Meaning |
---|---|
1 |
name of block |
2 |
name of the word (e.g., "yellow") |
3 |
the color the word is printed in (e.g., "red") |
4 |
Stroop color match (1=compatible, 0=incompatible) |
5 |
tablerow number |
6 |
the pressed key number |
7 |
Status (1=correct, 2=wrong, 3=timeout) |
8 |
Response time (milliseconds) |
Change Stroop task to a different language?
People regularly ask me if the code can be made for another language than English. Yes, and it is easy to do. All you need to do is the following:
-
Make sure you have a PsyToolkit account.
-
Download the experiment from this page.
-
Upload the downloaded experiment in your own PsyToolkit account.
Now you are ready for making the changes. I use Inkscape to make bitmaps such as "bluered.png". PsyToolkit has Inkscape lessons, and Inkscape is easy to use and free, but you can use other software just as well.
Change the stimuli so that the words are in your own language. Upload your new bitmap to your PsyToolkit experiment. Recompile. And it should work.
PsyToolkit code
Click to expand the PsyToolkit script code (part of zip file below)
bitmaps
instruction1
instruction2
correct
mistake
fixpoint
yellowyellow
yellowgreen
yellowblue
yellowred
redyellow
redgreen
redblue
redred
greenyellow
greengreen
greenblue
greenred
blueyellow
bluegreen
blueblue
bluered
fonts
arial 20
# table: write condition,stimulus,response
table stroop
"yellow yellow 1" yellowyellow 4
"yellow green 0" yellowgreen 2
"yellow blue 0" yellowblue 3
"yellow red 0" yellowred 1
"red yellow 0" redyellow 4
"red green 0" redgreen 2
"red blue 0" redblue 3
"red red 1" redred 1
"green yellow 0" greenyellow 4
"green green 1" greengreen 2
"green blue 0" greenblue 3
"green red 0" greenred 1
"blue yellow 0" blueyellow 4
"blue green 0" bluegreen 2
"blue blue 1" blueblue 3
"blue red 0" bluered 1
task stroop
table stroop
keys r g b y
delay 500
show bitmap fixpoint # stimulus 1
delay 200
clear 1 # remove fixpoint
delay 100
show bitmap @2 # stimulus 2
readkey @3 2000
clear 2 # remove stimulus 2
if STATUS == CORRECT
show bitmap correct # stimulus 3 (feedback)
fi
if STATUS != CORRECT # stimulus 3 (feedback)
show bitmap mistake
fi
delay 500
clear 3 # remove feedback stimulus
save BLOCKNAME @1 TABLEROW KEY STATUS RT
message instruction1
message instruction2
block training
task stroop 40 # run the stroop task 40 trials.
feedback
text -100 0 "Your speed in correct trials"
set &StroopCon mean c8 ; select c4 == 1 && c7 == 1
set &StroopInc mean c8 ; select c4 == 0 && c7 == 1
set &StroopEffect expression &StroopInc - &StroopCon
text -100 50 &StroopCon ; prefix "congruent: " ; postfix " ms"
text -100 100 &StroopInc ; prefix "incongruent: " ; postfix " ms"
text -100 150 &StroopEffect ; prefix "Your Stroop effect is incongruent minus congruent: " ; postfix " ms"
text -100 200 "Press space key to end"
end
Download
If you have a PsyToolkit account, you can upload the zipfile directly to your PsyToolkit account. Watch a video on how to do that. If you want to upload the zipfile into your PsyToolkit account, make sure the file is not automatically uncompressed (some browsers, especially Mac Safari, by default uncompress zip files). Read here how to easily deal with this. |
Further reading
-
Stroop, J.R. (1935). Studies of interference in serial verbal reactions. Journal of Experimental Psychology, 18, 643-662. Read here on Classics in the history of psychology.
-
MacLeod, C.M. (1991). Half a century of research on the Stroop effect: An integrative review. Psychological Bulletin, 109, 163-203.