how to exclude timeout trials in latency?


Author
Message
Ulrike Nestler
Ulrike Nestler
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 17, Visits: 41
Hi, i am programing my own version of the color shape task with Inquisit 4 Lab and I would like Inquisit NOT to count timeout ms to the parameter "latency"  of trials that have run out due to timeout. With the following script, Inquisit still counts the timeout to the latency. But I want to exclude the ms of timeout trials to the latency counting. But I can't just count those trials as invalid because I need to count them as omission errors.
How do I script that?
Exclude timeout trials from being counted to the latency and frnakly to the meanRT, and so on...
And still count timeout trials as omission errors?

This is a tiny part of the script, but I think somewhere under "/ontrialend" I am missing some commands...

<trial blueincongruent>
/ontrialbegin = [values.count_incongruent += 1]
/ontrialbegin = [values.congruency = 2]
/ pretrialpause = 200
/ stimulustimes = [0= fixation; 500=blueincongruent]
/ correctresponse = ("j")
/ validresponse = ("d", "f", "j", "k")
/ timeout = 2000
/ errormessage = true(x, 400)
/ontrialend = [if (trial.blueincongruent.correct) {values.countcorrect_incongruent += 1; values.sumrt_incongruent += trial.blueincongruent.latency}]
</trial>

I would be very thankful for some help.

Kind regards, Ulrike

Ulrike Nestler
Ulrike Nestler
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 17, Visits: 41
Correction: My questions and the script refers to my own Stroop Version and not Color Shape.
Thanks.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
> With the following script, Inquisit still counts the timeout to the latency.

What makes you think that?

<trial blueincongruent>
...
/ontrialend = [if (trial.blueincongruent.correct) {values.countcorrect_incongruent += 1; values.sumrt_incongruent += trial.blueincongruent.latency}]
</trial>

The above /ontrialend logic is executed under the condition that the response given was *correct*. Since "no response" (and thus the trial timing out) is not a correct response, that trial's latency would in fact not be added to values.sumrt_incongruent. You can run this analogous snippet to see this for yourself on-screen:

<values>
/ sumrt = 0
</values>

<block myblock>
/ trials = [1-10=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = ("d", "k")
/ correctresponse = ("k")
/ timeout = 2000
/ ontrialend = [if (trial.mytrial.correct) {values.sumrt+=trial.mytrial.latency; }; ]
</trial>

<text mytext>
/ items = ("Response on previous trial: <%trial.mytrial.response%> | Sum of latency: <%values.sumrt%>")
</text>

I assume I'm missing something here, so it would be great if you could elaborate.

EDITED TO ADD: I should perhaps note that the latency of timed-out trials *will* be included in some built-in properties aggregate properties (e.g. trial.blueincongruent.meanlatency). Those aggregate properties must be avoided in cases where you only want to include latencies under certain conditions (e.g., only when a response *did* occur, or only for correct responses, etc.). Instead, calculate the desired aggregates by using <values> entries and <expressions>. Taking the above example, you would calculate the mean rt *excluding* timed-out trials like this:

<values>
/ sumrt = 0
/ nresponses = 0
</values>

<expressions>
/ meanrt_response_only = (values.sumrt/values.nresponses)
</expressions>

<block myblock>
/ postinstructions = (results)
/ trials = [1-10=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = ("d", "k")
/ correctresponse = ("k")
/ timeout = 2000
/ ontrialend = [if (trial.mytrial.response != 0) {values.sumrt+=trial.mytrial.latency; values.nresponses+=1}; ]
</trial>

<text mytext>
/ items = ("Response on previous trial: <%trial.mytrial.response%> | Sum of latency: <%values.sumrt%> | N: <%values.nresponses%> | Mean RT: <%expressions.meanrt_response_only%>")
</text>

<page results>
^^Results after 10 trials:
^^Sum of latency: <%values.sumrt%> | N: <%values.nresponses%> | Mean RT: <%expressions.meanrt_response_only%>
</page>


In general, what you can do is check whether the trial's response property is 0 (=no response occurred) or not.

/ ontrialend = [if (trial.blueincongruent.response == 0) {values.ommisionerrors += 1; ...} ]

would count an ommission error if no response was given.

/ ontrialend = [if (trial.blueincongruent.response != 0) {....; } ]

would execute logic under the condition that *some* response was received (i.e, "not no response").

Edited 9 Years Ago by Dave
Ulrike Nestler
Ulrike Nestler
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 17, Visits: 41
Hi Dave,

the second scenario is exactly what i meant with my question. Thanks so much for your detailed answer! I will add your improvements to the script today and see if it works. ;-)
Thanks so much again for your fast response!
Kind regards,
Ulrike

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search