STROOP: Calculate and display RT for Congruent vs Incongruent Answers

OS Windows 7
PsychoPy version 1.84.2
Standard Standalone? (y/n) y

**What are you trying to achieve?
I’m running a stroop task for a public engagement event (rather than testing) and I would like to have feedback at the end the says the RT for Congruent = x and the RT for incongruent =Y so we can show that they are (typically) faster when it is congruent. I’m guessing I need to use some kind of if function within the code component, but i’m not sure how to do it. Any help would be appreciated

Hi. Yes, with a code component, you can maintain a running total of RTs for each trial type and then take their mean at the appropriate time for feedback. Probably easiest if you show us the variable names in your conditions file, but let’s say you have a column for letter colour and a column for the text content.

Put something like this in the Begin Experiment tab:

# initialise some variables:
n_congruent = 0
rt_congruent = 0.0

n_incongruent = 0
rt_incongruent = 0.0

Something like this in the End Routine tab of your experimental routine:

if letter_colour = text_content: # use your actual conditions file variables
    n_congruent = n_congruent + 1
    total_rt_congruent = rt_congruent  + your_keyboard_comnponent.rt
else:
    n_incongruent = n_incongruent + 1
    total_rt_incongruent = rt_incongruent  + your_keyboard_comnponent.rt

And something like this in the Begin Routine tab of your feedback routine:

mean_congruent = total_rt_congruent / n_congruent
mean_incongruent = total_rt_incongruent / n_incongruent

Those variables can then be used in a text component to give feedback.

Thank you for your super fast response that solved it.

If anybody is interested i’ve added a makey makey board to act like a keyboard and i’m using blobs of playdough to represent the colours to make this an interactive experiments suitable for explaining to children.

OK, so I admit I had to look up Makey Makey and it seems really cool:
http://www.makeymakey.com

Hope your study goes well.