Reply To: Choosing subet of items to present

PennController for IBEX Forums Support Choosing subet of items to present Reply To: Choosing subet of items to present

#6798
Jeremy
Keymaster

Hi Ana,

If I understand you correctly, your cond column will go from A through H (8 conditions) with 4 rows for each letter (4 items).

What I’m not clear about are your fillers: does your cond column go from filler-1 through filler-5 (5 types of fillers), with 4 rows for each one again (as hinted at by the repeated “1” in your example)?

The other thing I am confused about is how you get 2 fillers between each experimental item, when you run a total of 2*8 = 16 experimental items while you have defined 5*4 = 20 filler items: if you want 2 fillers between each of the 16 experimental items (and assuming you don’t want to repeat any filler) then you will need a total of at least 15*2 = 30 fillers items (if you do not run another 2 filler items after the last experimental item)

Maybe you meant “2 exp item + 2 fillers,” in which case you would need between 7*2 = 14 and 8*2 = 16 fillers items, so now you have defined too many: would you randomly pick 14 or 16 fillers out of the 20? This is what I will describe here anyway

So what I would do is label the trials generated from your table by their cond (and item) columns, so you can refer to “A”, “B”, etc. and randomly pick 2 of each when building your sequence. Randomizing a set of labeled trials is pretty straightforward, for example you can randomize all the trials who label starts with A- with randomize(startsWith("A-")). In order to pick 2 trials out of this set, you will need the function pick defined in this thread, then you can simply do pick( randomize(startsWith("A-")) , 2 ). Finally, you can store all your pairs of trials in an array and shuffle the array to run the pairs in a random order:

conditions = [
    pick(randomize(startsWith("A-")), 2),
    pick(randomize(startsWith("B-")), 2),
    // etc.
]
.sort( ()=>Math.random()-0.5 ) // shuffle

Here is a project that implements this idea: https://farm.pcibex.net/r/GtBCVh/

Let me know if you have questions

Jeremy