Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Randomization in specific orders

Hi there,

I have 4 similar sets of question, lets name this A1~A4. I know how to randomize the 4 blocks of questions, but i need to do this in a specific orders,
for ex:
1st possibility 1-2-3-4
2nd possibility 4-1-2-3 est..

I know it's strange, but can somebody give my an advice? Thanks.
asked Jul 18 by Ahmed Anwer

1 Answer

+1 vote
This can be done with randomized blocks and constructed lists.

Start by creating a predefined list with four items, then create a constructed list with that predefined list as its parent and these instructions:

Begin Unverified Perl
my $plist = 'list1';
if (SYSRAND() > 0.5) {
    ADD($plist);
}
else {
    ADD($plist, 4);
    ADD($plist, 1, 3);
}
End Unverified


"list1" should be replaced with the name of your predefined list.

Finally, add a randomized block to your questionnaire.  It should be set to use your constructed list, with each anchored question pair being A1, A2, A3, and A4.
answered Jul 18 by Zachary Platinum Sawtooth Software, Inc. (121,725 points)
Zachary, I was just looking at this post.

Is Ahmed wanting a 3rd possibility like 3-4-1-2 and a 4th like 4-1-2-3?
Good point.  In that case, I'd probably do something like this to represent each possible combination:

Begin Unverified Perl
my $plist = 'list1';
my $rand = SYSRAND(1, 4);
if ($rand == 1) {
    ADD($plist);
}
elsif ($rand == 2) {
    ADD($plist, 4);
    ADD($plist, 1, 3);
}
elsif ($rand == 3) {
    ...
}
End Unverified


Just keep in mind that the second parameter to SysRand should be one MORE than the total number of combinations needed.
That should cover the 4 possible combinations. Nice work!
...