﻿<?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 3  » Problem with randomized subjectid numbers</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 23 May 2026 04:10:04 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Problem with randomized subjectid numbers</title><link>https://forums.millisecond.com/Topic4652.aspx</link><description>&lt;p&gt;Hmm, weird. Maybe several subjects have taken the study from the same PC without refreshing the launch page -- this used to be a potential issue a while back, if I remember correctly. However, nowadays the launch page should prevent this from happening, I think. Anyway, given the huge variety in browsers, ad- and scriptblockers people are running in the wild, there might be a few combinations out there throwing things off. Back on topic, though: I'd prepend time and / or date information to the subject id in order to make each one unique (easily done in SPSS via concat()) -- in case of just one between-subjects condition with two levels (odd vs. even) this will keep the condition assignment encoded in the subject id intact while getting rid of the duplicate ids. E.g. subject 3 run on 10-10-2009 at 13:00 might become 1010200913003 while subject 3 run on 10-15-2009 at 08:32 might become 1015200908323, etc.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Wed, 16 Jun 2010 16:18:20 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Problem with randomized subjectid numbers</title><link>https://forums.millisecond.com/Topic4651.aspx</link><description>&lt;p&gt;Hi Dave --&lt;/p&gt;
&lt;p&gt;Thanks for the link... yes, it was hosted on the millisecond.com server, so it's still a mystery why there would be identical subject IDs. I'm less worried about the even-odd distribution than the merging of datasets (unfortunately I get four different output files from my survey, I haven't figured out how to get just one data file). I merge by comparing subject IDs, so they have to be unique. &lt;/p&gt;
&lt;p&gt;Josh&lt;/p&gt;
</description><pubDate>Wed, 16 Jun 2010 15:57:05 GMT</pubDate><dc:creator>barsad</dc:creator></item><item><title>RE: Problem with randomized subjectid numbers</title><link>https://forums.millisecond.com/Topic4649.aspx</link><description>&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;Was the script hosted at millisecond.com or at your own server? This makes a difference and is explained at length in this help topic: &lt;a href="/support/docs/v3/html/articles/websubjectnumbers.htm"&gt;http://www.millisecond.com/support/docs/v3/html/articles/websubjectnumbers.htm&lt;/a&gt;. Possibly relevant quote:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;i&gt;"Subject number assignment for scripts hosted on other servers&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;i&gt;[...]&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;i&gt;
        In the source code for the page is a javascript method called 
"GetSubjectNumber"
        that is responsible for generating the subject number. For 
random generation, the
        method looks like this:&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
    &lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span class="caption"&gt;Figure 2.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;i&gt;function GetSubjectNumber() &lt;br /&gt;{ &lt;br /&gt;   return (Math.floor(Math.random() * 1000000000)); &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;Note that we are selecting numbers with replacement, so it is theoretically possible that two participants might be assigned the &lt;br /&gt;same subject number. However, the chances are slim indeed, and if it does happen, you can use the time of the session as &lt;br /&gt;logged in the "date" and "time" data columns to distinguish the subjects' data."&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;Also note that the mere fact that some subjects have the same number does not necessarily skew the distribution of even and odd numbers.&lt;br /&gt;&lt;br /&gt;Hope this helps,&lt;br /&gt;~Dave&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;</description><pubDate>Wed, 16 Jun 2010 15:09:39 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>Problem with randomized subjectid numbers</title><link>https://forums.millisecond.com/Topic4648.aspx</link><description>&lt;p&gt;Hello --&lt;/p&gt;
&lt;p&gt;I am using the standard randomized Subject ID script to assign subject numbers for a Web experiment, which is the following:&lt;/p&gt;
&lt;pre id="line263"&gt;function GetSubjectNumber()&lt;br /&gt;{&lt;br /&gt;    var snum = Math.floor(Math.random() * 1000000000);&lt;br /&gt;	return snum.toString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;But for some reason several subjects (about 10) were given the same subject number when taking the survey. I know this isn't supposed to happen when it's randomly assigning numbers between 1 and 1000000000, but it is. Has anyone had this bug, and how might I correct it?&lt;br /&gt;I need to have an even number of evenly-numbered and odd-numbered subject IDs.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Josh&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</description><pubDate>Wed, 16 Jun 2010 14:57:38 GMT</pubDate><dc:creator>barsad</dc:creator></item></channel></rss>