﻿<?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  » How to determine which batch or expt was run based on subject id or group id</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 01 May 2026 16:31:31 GMT</lastBuildDate><ttl>20</ttl><item><title>How to determine which batch or expt was run based on subject id or group id</title><link>https://forums.millisecond.com/Topic13856.aspx</link><description>Inquisit allows you to perform between-subject manipulations at the &amp;lt;batch&amp;gt; or &amp;lt;expt&amp;gt; level using the / subjects attribute. For example, the following varies the order of the script based on groupid:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (1 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;/file="foo.iqx"&lt;div&gt;/file="bar.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (2 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;&lt;div&gt;/file="bar.iqx"&lt;br/&gt;/file="foo.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;When the experiment runs, Inquisit assigns a participant to one or the other &amp;lt;batch&amp;gt; based on the group id, which, depending on configuration, could be a randomly or sequentially generated number, or something entered by the researcher or the participant. Let's say the group id was a randomly generated value of 18843245. How do you determine which &amp;lt;batch&amp;gt; that group id value corresponds to?&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;This can be determined with the following formula:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((groupid - 1) % groupcount) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;where groupcount is the total number of groups (2 in the above example) and % represents the modulus operator, which&amp;nbsp;&lt;span style="font-size: 10pt;"&gt;returns the remainder after the&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;numerator is divided by the denominator. If we plug the values from our example into the formula, we get:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((&lt;span style="font-size: 10pt;"&gt;18843245 - 1) % 2) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;which is equal to 1. In other words, this particular participant ran group 1, where foo.iqx was administered first and bar.iqx was administered second. If /groupassigment = subjectnumber or is unassigned, we would use the same formula but plug in the subject id rather than the group id.&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;When analyzing your data, you'll want to calculate a group variable using this formula in order to test or control for order effects or other between-subject manipulations. If you are using Microsoft Excel, the formula is "=MOD(A2-1, 4) +1" where A2 is the cell that has the subject or group id.&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</description><pubDate>Thu, 31 Aug 2017 13:32:13 GMT</pubDate><dc:creator>seandr</dc:creator></item><item><title>RE: How to determine which batch or expt was run based on subject id or group id</title><link>https://forums.millisecond.com/Topic22369.aspx</link><description>&lt;div data-id="22368" class="if-quote-wrapper" unselectable="on" data-guid="1504211254197"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22368" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="22368" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="22368" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;hollysully - Thursday, August 31, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22368"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="13856" class="if-quote-wrapper" unselectable="on" data-guid="1504211254197"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="13856" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="13856" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="13856" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;seandr - Friday, July 25, 2014&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-13856"&gt;&lt;div class="if-quote-message-margin"&gt;Just want to check:&amp;nbsp; the 4 in the Excel formula:&amp;nbsp; "=MOD(A2-1, 4) +1"&amp;nbsp; represents 4 groups, is that correct? The example used 2 groups but the Excel formula represents 4 groups, so I wanted to make sure. &lt;br/&gt;Thanks, &lt;br/&gt;Holly&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Inquisit allows you to perform between-subject manipulations at the &amp;lt;batch&amp;gt; or &amp;lt;expt&amp;gt; level using the / subjects attribute. For example, the following varies the order of the script based on groupid:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (1 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;/file="foo.iqx"&lt;div&gt;/file="bar.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (2 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;&lt;div&gt;/file="bar.iqx"&lt;br/&gt;/file="foo.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;When the experiment runs, Inquisit assigns a participant to one or the other &amp;lt;batch&amp;gt; based on the group id, which, depending on configuration, could be a randomly or sequentially generated number, or something entered by the researcher or the participant. Let's say the group id was a randomly generated value of 18843245. How do you determine which &amp;lt;batch&amp;gt; that group id value corresponds to?&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;This can be determined with the following formula:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((groupid - 1) % groupcount) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;where groupcount is the total number of groups (2 in the above example) and % represents the modulus operator, which&amp;nbsp;&lt;span style="font-size: 10pt;"&gt;returns the remainder after the&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;numerator is divided by the denominator. If we plug the values from our example into the formula, we get:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((&lt;span style="font-size: 10pt;"&gt;18843245 - 1) % 2) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;which is equal to 1. In other words, this particular participant ran group 1, where foo.iqx was administered first and bar.iqx was administered second. If /groupassigment = subjectnumber or is unassigned, we would use the same formula but plug in the subject id rather than the group id.&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;When analyzing your data, you'll want to calculate a group variable using this formula in order to test or control for order effects or other between-subject manipulations. If you are using Microsoft Excel, the formula is "=MOD(A2-1, 4) +1" where A2 is the cell that has the subject or group id.&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="13856"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22368"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Yes, that is correct. The modulus ought to be equal to the number of groups / conditions you had. In other words:&lt;br/&gt;If you had two conditions, you'd calculate groupnumber modulo 2, &lt;br/&gt;if you had three conditions, you'd calculate the groupnumber modulo 3, &lt;br/&gt;if you had four conditions, you'd calculate the groupnumber modulo 4, and so forth.&lt;br/&gt;</description><pubDate>Thu, 31 Aug 2017 13:32:13 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title /><link>https://forums.millisecond.com/Topic22368.aspx</link><description>&lt;div data-id="13856" class="if-quote-wrapper" unselectable="on"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="13856" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="13856" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="13856" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;seandr - Friday, July 25, 2014&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-13856"&gt;&lt;div class="if-quote-message-margin"&gt;Just want to check:&amp;nbsp; the 4 in the Excel formula:&amp;nbsp; "=MOD(A2-1, 4) +1"&amp;nbsp; represents 4 groups, is that correct? The example used 2 groups but the Excel formula represents 4 groups, so I wanted to make sure. &lt;br/&gt;Thanks, &lt;br/&gt;Holly&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Inquisit allows you to perform between-subject manipulations at the &amp;lt;batch&amp;gt; or &amp;lt;expt&amp;gt; level using the / subjects attribute. For example, the following varies the order of the script based on groupid:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (1 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;/file="foo.iqx"&lt;div&gt;/file="bar.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&amp;lt;batch&amp;gt;&lt;div&gt;/ subjects = (2 of 2)&lt;div&gt;/ groupassignment = groupnumber&lt;/div&gt;&lt;/div&gt;&lt;div&gt;/file="bar.iqx"&lt;br/&gt;/file="foo.iqx"&lt;div&gt;&amp;lt;/batch&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;When the experiment runs, Inquisit assigns a participant to one or the other &amp;lt;batch&amp;gt; based on the group id, which, depending on configuration, could be a randomly or sequentially generated number, or something entered by the researcher or the participant. Let's say the group id was a randomly generated value of 18843245. How do you determine which &amp;lt;batch&amp;gt; that group id value corresponds to?&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;This can be determined with the following formula:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((groupid - 1) % groupcount) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;where groupcount is the total number of groups (2 in the above example) and % represents the modulus operator, which&amp;nbsp;&lt;span style="font-size: 10pt;"&gt;returns the remainder after the&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;numerator is divided by the denominator. If we plug the values from our example into the formula, we get:&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;group = ((&lt;span style="font-size: 10pt;"&gt;18843245 - 1) % 2) + 1&lt;div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;which is equal to 1. In other words, this particular participant ran group 1, where foo.iqx was administered first and bar.iqx was administered second. If /groupassigment = subjectnumber or is unassigned, we would use the same formula but plug in the subject id rather than the group id.&amp;nbsp;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;When analyzing your data, you'll want to calculate a group variable using this formula in order to test or control for order effects or other between-subject manipulations. If you are using Microsoft Excel, the formula is "=MOD(A2-1, 4) +1" where A2 is the cell that has the subject or group id.&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="13856"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 31 Aug 2017 12:56:52 GMT</pubDate><dc:creator>hollysully</dc:creator></item></channel></rss>