﻿<?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  » a setitem problem or a selection problem</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 30 Apr 2026 02:06:49 GMT</lastBuildDate><ttl>20</ttl><item><title>a setitem problem or a selection problem</title><link>https://forums.millisecond.com/Topic17831.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;In a dot-probe-experiment, I assign the dots (.. or :) on the basis of a list. If a particular value is selected from the list, either a vertical or a horizontal dot-pair is presented. At least, that is the idea. However, vertical dots are presented more often than horizontal ones (about three times as often as horizontal ones) according to a tally made during the experiment. I tried to check the presentation frequency by storing the picture-filename in a variable. According to the analysis of this variable (values.file.name) horizontal and vertical dots appears equally often. So, where is my error? &lt;br/&gt;</description><pubDate>Thu, 26 Nov 2015 01:59:47 GMT</pubDate><dc:creator>jens</dc:creator></item><item><title>RE: a setitem problem or a selection problem</title><link>https://forums.millisecond.com/Topic17844.aspx</link><description>Cool. Jens&lt;br/&gt;</description><pubDate>Thu, 26 Nov 2015 01:59:47 GMT</pubDate><dc:creator>jens</dc:creator></item><item><title>RE: a setitem problem or a selection problem</title><link>https://forums.millisecond.com/Topic17834.aspx</link><description>Jens,&lt;br/&gt;&lt;br/&gt;&amp;lt;picture dot.pic&amp;gt;&lt;br/&gt;/items = ("DotHor.png", "DotVer.png")&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;Defines a &amp;lt;picture&amp;gt; element with two items. Since no /select attribute is specified, the default is used -- which is 'noreplace'.&lt;br/&gt;&lt;br/&gt;In your &amp;lt;trial&amp;gt; elements, you constantly change what the *first* item in that &amp;lt;picture&amp;gt; element is:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial target.neg.left&amp;gt;&lt;br/&gt;/ontrialbegin = [if (list.pos.tar.neg.left.nextvalue == 1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {picture.dot.pic.hposition = values.left; values.pos = values.left; &lt;strong&gt;picture.dot.pic.setitem("DotHor.png", 1)&lt;/strong&gt;; values.file.name = "DotHor.png";}&lt;br/&gt;...&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (list.pos.tar.neg.left.nextvalue == 4) {picture.dot.pic.hposition = values.right; values.pos = values.right; &lt;strong&gt;picture.dot.pic.setitem("DotVer.png", 1&lt;/strong&gt;); values.file.name = "DotVer.png";}]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;That, however, *does not change the fact that there are two items in the element which are being sampled randomly without replacement*. There is no reason whatsoever why only the 1st item -- which is what you set -- should be sampled and thus displayed in any given trial. &lt;br/&gt;&lt;br/&gt;Suppose that in the very first trial you run, you set the 1st item to "DotVer.png". Your &amp;lt;picture&amp;gt; element now effectively looks like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;picture dot.pic&amp;gt;&lt;br/&gt;/items = ("Dot&lt;strong&gt;Ver&lt;/strong&gt;.png", "Dot&lt;strong&gt;Ver&lt;/strong&gt;.png")&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;i.e., you now sample without replacement from *two identical items*. Further suppose that in that first trial the 1st item is randomly drawn. The trial will thus display "Dot&lt;strong&gt;Ver&lt;/strong&gt;.png".&lt;br/&gt;&lt;br/&gt;Since you are sampling *without replacement*, in the *next* trial the 2nd item will *inevitably* be sampled -- which is also "DotVer.png". And this is true *regardless* of whatever you set the 1st item to at the beginning of that 2nd trial. That's where you're apparent "mismatches" come from.&lt;br/&gt;&lt;br/&gt;You either need to make sure that the &amp;lt;picture&amp;gt; constantly selects the 1st item as in &lt;br/&gt;&lt;br/&gt;&amp;lt;picture dot.pic&amp;gt;&lt;br/&gt;/items = ("Dot&lt;strong&gt;Hor&lt;/strong&gt;.png", "Dot&lt;strong&gt;Ver&lt;/strong&gt;.png")&lt;br/&gt;&lt;strong&gt;/ select = 1&lt;/strong&gt;&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;or abandon the setitem() approach, which is what I would *highly* recommend due to performance reasons alone. Instead use a simple variable to select the proper item as in&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ dot.pic.item = 1&lt;br/&gt;...&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture dot.pic&amp;gt;&lt;br/&gt;/items = ("Dot&lt;strong&gt;Hor&lt;/strong&gt;.png", "Dot&lt;strong&gt;Ver&lt;/strong&gt;.png")&lt;br/&gt;&lt;strong&gt;/ select = values.dot.pic.item&lt;/strong&gt;&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&lt;br/&gt;&amp;lt;trial target.neg.left&amp;gt;&lt;br/&gt;/ontrialbegin = [if (list.pos.tar.neg.left.nextvalue == 1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {picture.dot.pic.hposition = values.left; values.pos = values.left; &lt;strong&gt;values.dot.pic.item =&amp;nbsp; 1&lt;/strong&gt;; values.file.name = "DotHor.png";}&lt;br/&gt;...&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (list.pos.tar.neg.left.nextvalue == 4) {picture.dot.pic.hposition = values.right; values.pos = values.right; &lt;strong&gt;values.dot.pic.item = 2&lt;/strong&gt;; values.file.name = "DotVer.png";}]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;and so forth.&lt;br/&gt;</description><pubDate>Wed, 25 Nov 2015 08:33:26 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>