psychopy.org | Reference | Downloads | Github

Counterbalancing Stimuli AND Randomize Subtasks

OS (e.g. Win10): Mac
PsychoPy version (e.g. 1.84.x): v2020.2.10
What are you trying to achieve?:
I am trying to create an experiment whereby the trial stimuli differs depending on what condition participants get assigned to (i.e., condition A, B, or C) but I would also like to counterbalance the subtasks participants are exposed to within a block. For example, regardless of what condition they are assigned (I.e., A, B, or C) they will be randomized to either complete a math task or vocab task within the same block.

My problem is that I do not know how to do both of these tasks within a loop structure itself. Should the condition randomization be in an inner loop and then the randomization of subtrial tasks be in the outer loop or vice versa? Or is there another approach which is better?

Thank you for your time,
Paige

Hi There,

Firstly, I notice that you are working on an older version of PsychoPy - if you are at the start point of making a task I highly recommend updating to 2021.2.3 - this will be much smoother and have newer features!

More specifically to your question - this might help Blocks of trials and counterbalancing — PsychoPy v2021.3

Does each group have a different math/vocab task? but within you group you want it to be random if the math or vocab is presented first - is that correct?

Thanks,
Becca

Hey Becca,

Thank you for the response, I have just updated my version of PsychoPy - thanks for the recommendation.

I have been through the instructions on the Blocks of trials and counterbalancing — PsychoPy v2021.3 but I am struggling to input them into the design of my experiment.

In regards to your question:

  • There are 5 groups that people get randomly assigned to, such that the stimuli is different for each group. For example,

So I have 10 different excel documents to import into the experiment which I do by including the following code in the Begin Experiment Tab.

chars = ["A", "B", "C", "D", "E"];
shuffle(chars);
condition = chars[0];

However, I want to randomize what participants do each trial regardless of what group they have been assigned to, but I am unsure on how to do this in PsychoPy. For example, for the first five trials they could have done:

  • Math Task
  • Vocab Task
  • Vocab Task
  • Math Task
  • Math Task

I tried to randomize what subtasks subjects would complete each trial by adding an outerloop which links to an excel file that states whether a Math trial or Vocab Trial should be shown Subtasks.xlsx (8.7 KB)
(counterbalancing subtasks in: Blocks of trials and counterbalancing — PsychoPy v2021.3). However, my problem is that the subtasks are still not switching across trials. Experiment.psyexp (29.3 KB)