Millisecond Forums

Displaying correct responses and response latency after task

https://forums.millisecond.com/Topic19800.aspx

By thestruggleisreal - 10/4/2016

Hi Dave (or whoever knows the answer to my question)

I would like to display the number of correct/incorrect answers as well as the average response latency of my Go/NoGo task to participants at the end of the task (output variables "correct" and "latency"). Is it possible to do so?

Thanks in advance for your answer,

Cheers
By Dave - 10/5/2016

Yes. For a go/nogo paradigm, you'll want to set up a bunch of <values> and <expressions> to track the metrics of interest (number of responses, number of correct responses, mean latency for trials where a response occurred). You can then report those statistics back to the participant via a <page> or <trial> element. Basic example:

<values>
/ sumlatency = 0
/ nresponses = 0
/ ncorrect = 0
/ ntrials = 0
</values>

<expressions>
/ meanlat = (values.sumlatency/values.nresponses)
/ pctcorrect = (values.ncorrect/values.ntrials)*100
</expressions>

<expt>
/ postinstructions = (performance)
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1-12 = noreplace(go, nogo, nogo)]
</block>

<trial go>
/ ontrialend = [if (trial.go.response != 0) {values.sumlatency += trial.go.latency; values.nresponses += 1;};]
/ ontrialend = [values.ncorrect += trial.go.correct]
/ ontrialend = [values.ntrials += 1]
/ stimulusframes = [1=gotxt]
/ validresponse = (57, 0)
/ correctresponse = (57)
/ timeout = 2000
</trial>

<trial nogo>
/ ontrialend = [if (trial.nogo.response != 0) {values.sumlatency += trial.go.latency; values.nresponses += 1;};]
/ ontrialend = [values.ncorrect += trial.nogo.correct]
/ ontrialend = [values.ntrials += 1]
/ stimulusframes = [1=nogotxt]
/ validresponse = (57, 0)
/ correctresponse = (0)
/ timeout = 2000
</trial>

<text gotxt>
/ items = ("RESPOND!")
/ txcolor = green
</text>

<text nogotxt>
/ items = ("Do NOT respond.")
/ txcolor = red
</text>

<page performance>
^Your mean RT was <%expressions.meanlat%> ms.
^You responded correctly in <%expressions.pctcorrect%> % of all trials.
</page>
By thestruggleisreal - 10/5/2016

Thanks a bunch, Dave. I'll give it a try :-)