Millisecond Forums

Problem in the database when using a Stroop Task

By vpillaud - 4/14/2014


I've downloaded and modified the Stroop script that is provided by your website for an experiment. I've noticed an important problem in the database and would like to know if there is a simple way to fix it.

As a reminder, a Stroop task randomly displays congruent and incongruent trials. You can see in the screenshot below that, instead of reporting a blank in the congruent column when displaying an incongruent trial, it copies the value of the previous congruent column. The highlighted cases are the problematic ones.

Copying the previous value is actually creating false means (as it duplicates values) and hence, completely messes up the data. I'd like it to report a blank in the congruent column when displaying an incongruent trail (as shown below). Is there a way to do this ??

Thanks for your help.

Regards, Vincent.

By Dave - 4/14/2014

No, nothing is duplicated here and no means are distorted in any way either. These expressions *are* the respective means given the data up to the given point in time. And since the mean for congruent trials does not change during incongruent trials the value remains the same.
By vpillaud - 4/16/2014

wished it was the case but unfortunately it is not. The reported mean does not correspond to the average of the separated latencies...

I can give you the data if you want me too.
By Dave - 4/16/2014

Please do.
By vpillaud - 4/16/2014

ok. By now, there are two control trials and twelve trials (either congruent or incongruent) in the script. It'll be modified later on.

The two zeros at the beginning are thus due to the control trials.

In its summary, Inquisit reports a mean of 1099 for the congruent items and 740.66 for the incongruent in this example. However, when i compute the mean myself, including or excluding the two zeros, I never obtain the same value (as shown in the screenshot).

The means displayed in the summary are computed as:
expressions.congruentRT = meanlatency(trial.bluecongruent, trial.redcongruent)

I cannot find the values of the trial.bluecongruent and trial.redcongruent in the raw datafile (they are not saved). Hence, I couldnt check if something was wrong at this level. Am I computing the means in a wrong way ? (such as not using the right values for it for instance).

Thanks for your help, really appreciate.


By Dave - 4/16/2014

expressions.congruentRT = meanlatency(trial.bluecongruent, trial.redcongruent)

means whatever the expression in your data file contains in a given line *is the mean at this given point in time*. What you are calculating manually is thus the "mean of means", which of course does not make any sense.

If you want to manually check the results of the expressions, you ought to sum up the raw latencies in the data file's 'latency' column by trial type (sum up latencies for congruent trials, sum up latencies for incongruent trials) and divide the respective sums by the appropriate number of trials (i.e., number of congruent trials, number of incongruent trials).

In a nutshell:

<block myblock>
/ trials = [1-20=noreplace(a1,a2,b1,b2)]

/ a_rtsum = 0
/ a_ntrials = 0
/ b_rtsum = 0
/ b_ntrials = 0

/ a_meanrt = (values.a_rtsum / values.a_ntrials)
/ a_meanrt2 = meanlatency(trial.a1, trial.a2)
/ b_meanrt = (values.b_rtsum / values.b_ntrials)
/ b_meanrt2 = meanlatency(trial.b1, trial.b2)

<trial a1>
/ ontrialend = [values.a_ntrials += 1; values.a_rtsum += trial.a1.latency]
/ stimulusframes = [1=mytext]
/ validresponse = (57)

<trial a2>
/ ontrialend = [values.a_ntrials += 1; values.a_rtsum += trial.a2.latency]
/ stimulusframes = [1=mytext]
/ validresponse = (57)

<trial b1>
/ ontrialend = [values.b_ntrials += 1; values.b_rtsum += trial.b1.latency]
/ stimulusframes = [1=mytext]
/ validresponse = (57)

<trial b2>
/ ontrialend = [values.b_ntrials += 1; values.b_rtsum += trial.b2.latency]
/ stimulusframes = [1=mytext]
/ validresponse = (57)

<text mytext>
/ items = ("<%script.currenttrial%>")
/ columns = [trialnum, trialcode, response, latency,
    values.a_rtsum, values.a_ntrials, expressions.a_meanrt, expressions.a_meanrt2,
    values.b_rtsum, values.b_ntrials, expressions.b_meanrt, expressions.b_meanrt2,

By vpillaud - 4/16/2014

I see. Thanks for this clear explanation.


By vpillaud - 4/17/2014

btw, is there a possibility to print the latencies per stimuli in the raw data file ?

By Dave - 4/17/2014

All that's already in the data file. You have the latency column and you have stimulusitem columns (unless you've explicitly excluded them)