﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 4  » total count for "values"</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 26 Sep 2026 23:53:52 GMT</lastBuildDate><ttl>20</ttl><item><title>total count for "values"</title><link>https://forums.millisecond.com/Topic17720.aspx</link><description>Hi,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I've created a 'value' &amp;nbsp;(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".&amp;nbsp;&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Thanks in advance.&amp;nbsp;&lt;br/&gt;Stéphane&amp;nbsp;</description><pubDate>Sun, 15 Nov 2015 07:40:08 GMT</pubDate><dc:creator>sdandeneau</dc:creator></item><item><title>RE: total count for "values"</title><link>https://forums.millisecond.com/Topic17725.aspx</link><description>+= 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 &lt;br/&gt;&lt;br/&gt; values.sumresponses+=values.response&lt;br/&gt;&lt;br/&gt;using just basic addition would be&lt;br/&gt;&lt;br/&gt; values.sumresponses=values.sumresponses+values.response&lt;br/&gt;&lt;br/&gt;Increment and decrement operators merely allow for more concise code.&lt;br/&gt;</description><pubDate>Sun, 15 Nov 2015 07:40:08 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: total count for "values"</title><link>https://forums.millisecond.com/Topic17722.aspx</link><description>Wonderful... didn't know about the "+=" function (as in values.sumresponses += values.responses).&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks again!&lt;br/&gt;Stéphane</description><pubDate>Fri, 13 Nov 2015 21:24:22 GMT</pubDate><dc:creator>sdandeneau</dc:creator></item><item><title>RE: total count for "values"</title><link>https://forums.millisecond.com/Topic17721.aspx</link><description>You need to create another &amp;lt;values&amp;gt; entry and sum up the response across all trials.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ response = 0&lt;br/&gt;/ sumresponses = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-10=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ validresponse = (32, 37)&lt;br/&gt;/ ontrialend = [if (trial.mytrial.response == 32) values.response=1 else values.response=0; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.sumresponses+=values.response; ]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Press D or K. D -&amp;gt; values.response = 1; K -&amp;gt; values.response = 0")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = [trialnum trialcode response latency values.response values.sumresponses]&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 13 Nov 2015 06:39:06 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>