Randomization BUT with set proportions of trials

OS Windows 11 Pro
PsychoPy-2022.2.4

Hello everyone,

I’m trying to create a task containing 60 trials. I need the trial order to be randomized BUT maintain the following trial proportions among two response rule sets (switch & non-switch).

  • Switch trials: trial - trial there’s a change in response rule set → 50%

  • Non-switch trials: trial by trial the response rule set stays the same → 50% (25% homogeneous condition #1; 25% homogeneous condition #2).

If anyone is able to point me in the right direction or to some relevant resources it would be much appreciated.

Kind regards,
Jacob.

Hi,

You might be able to adapt my Trial Switching demo. What I do is preload the stimuli and shuffle a list of 1s and 0s for each stimulus type which specify whether the next trial is a switch or not. In my demo I have letters and numbers which I think would correspond to your conditions 1 and 2 .

Hi Wake,

Thanks for offering your help.

I can see what I can do.

Thanks!