#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# Is it possible to have some trials occur more frequently?

Hello,

I am programming a cueing paradigm, following the beginners tutorial. In the tutorial, all conditions occur equally frequently. If I wanted 'valid' trials to occur 80% of the time and 'invalid' to occur 20% of the time, is there a way to do this?

• Hi,

Yes, you can use the `weight` operation of the `loop` item, which is described here:

Essentially, you create a column, say `w`, that indicates how often a particular should be repeated; in your case that would be 4 for valid trials, and 1 for invalid trials, resulting in an 80%/20% ratio. And then you add a line `weight w` to the script of the `loop` item.

Does that make sense?

Cheers,
Sebastiaan

• Yes that makes perfect sense, thank you!

• Hi,

I am using a similar paradigm (different % of valid/invalid trials) and included the weight function accordingly. Additionally, I'd like to randomize the sequence of all trials. Currently, the trials as defined in the rows of the loop-table are randomized but if I apply a weight to a row (e.g. 4), the trial defined in that row is always repeated 4 times in sequence.

Example:

word weight

bunny 1

carrot 4

The list [bunny, carrot] is shuffled but I want the list [bunny, carrot, carrot, carrot, carrot] to be shuffled. Is that possible without major changes of my loop-table?

Best, Stefanie

• Hi Stefanie,

Yes, you can do that by adding a `shuffle` operation after the `weight` operation! See also:

Cheers!

Sebastiaan