total count for "values"


Author
Message
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: 13K, Visits: 104K
+= is the increment operator. You'll find this and all other available operators covered in the Inquisit documentation's "Operators" topic. Note, however, that one does not even need the increment operator to sum up values across trials. An equivalent way to express

values.sumresponses+=values.response

using just basic addition would be

values.sumresponses=values.sumresponses+values.response

Increment and decrement operators merely allow for more concise code.

sdandeneau
sdandeneau
Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)
Group: Forum Members
Posts: 37, Visits: 141
Wonderful... didn't know about the "+=" function (as in values.sumresponses += values.responses). 

Thanks again!
Stéphane
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: 13K, Visits: 104K
You need to create another <values> entry and sum up the response across all trials.

<values>
/ response = 0
/ sumresponses = 0
</values>

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


<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (32, 37)
/ ontrialend = [if (trial.mytrial.response == 32) values.response=1 else values.response=0;
    values.sumresponses+=values.response; ]
</trial>

<text mytext>
/ items = ("Press D or K. D -> values.response = 1; K -> values.response = 0")
</text>

<data>
/ columns = [trialnum trialcode response latency values.response values.sumresponses]
</data>



sdandeneau
sdandeneau
Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)Guru (5.1K reputation)
Group: Forum Members
Posts: 37, Visits: 141
Hi, 

I've created a 'value'  (e.g. "response" is : 0 or 1 for each trial) depending on what the subject responds. I would now like to create a second value that computes the sum of the "response" value across all trials at the end of the experiment, i.e. what is the total of "response", in order to easily compute a "final response score". 

It would be very similar to "trial.sometrial.totaltrialcount/totalcorrect etc..." but I can't seem to figure out this option for a value that I created.

Thanks in advance. 
Stéphane 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search