Not that I’m in trouble, but I’m just being curious about the logic behind how Ibex’s latin square function interacts with its shuffle() function.
Suppose that an experiment consists of 4 sets of 4 conditions, which are given different Type names (a, b, c, d), as well as 4 fillers.
[["a", 1], …]
[["b", 1], …]
[["c", 1], …]
[["d", 1], …]
[["a", 4], …]
[["b", 4], …]
[["c", 4], …]
[["d", 4], …]
I understand that in such a case, using anyOf("a", "b", "c", "d") along with shuffle() would yield a desirable order of presentation in which one of the 4 conditions and one of the 4 fillers alternates.
What I don’t understand is, without anyOf(), the first 3 fillers are always presented first.
var shuffleSequence = seq(shuffle("a", "b", "c", "d", "filler"));
Some sample outcomes:
f1 f2 f3 4d 2b 1a f4 3c
f1 f2 f3 2d f4 1c 4b 3a
f1 f2 f3 2b 3c f4 4d 1a
f1 f2 f3 1c 4b 3a f4 2d
f1 f2 f3 1a 3c 2b f4 4d
f1 f2 f3 4b 2d 1c 3a f4
(Note: randomize() is not used.)
Why do the first 3 fillers come first, and why 3, not 1, 2, or 4?
Also, the order of appearance of the target items seems randomized. Why? Just being curious.
Without shuffle(), the order of presentation would be very predictable and straightforward.
var shuffleSequence = seq("a", "b", "c", "d", "filler");
1a 2b 3c 4d f1 f2 f3 f4
4a 1b 2c 3d f1 f2 f3 f4
3a 4b 1c 2d f1 f2 f3 f4
2a 3b 4c 1d f1 f2 f3 f4
The documentation states:
“A statement of the form shuffle(pred1, pred2, pred3, ...) specifies that items matching the given predicates should be shuffled together in such a way that items matching each predicate are evenly spaced. The original relative ordering between items of the same type is preserved.”
But in the above instance of shuffle(), the predicates do not seem to be evenly spaced. I bet that the Group specification is doing some trick but I’m wondering what trick it’s doing.
I sometimes give an introductory tutorial on Ibex to friends and students, but I always find myself unable to provide an explanation for this.
If anybody has an idea, I would appreciate it. Thank you!