psychopy.org | Reference | Downloads | Github

Randomizing the selection of the lists at the beginning of an experiment

Hello, I have a simple question here. I created a lexical decision task with 4 different lists. I have no problems with running the experiment with only 1 list. What I want to do is to psychopy to pick one of the four lists at the beginning of the experiment, so that each participant can complete only 1 list. It would also be better if the number of participants amongs lists could be similar/equal. I will use pavlovia.org to run the experiment, if that is relevant. How can I do this with the builder?

Thanks in advance.

I would recommend these YouTube channels to begin with Psychopy:

https://www.youtube.com/channel/UC4FGNgoyJ5XM_NgJb8lGw3Q

https://www.youtube.com/user/peircej

Best,
Shardul

Thanks, I checked those videos but couldn’t find the answer.

Here is my experiment. Everything works great; ‘trials’ loop runs experimental_trials.xlsx without a problem. What I want to do is to make ‘trials’ loop to choose among 4 excel files at the beginning of the experiment - rather than running a fixed excel file (experimental_trials.xlsx).

HI! You might want to try adapting something along these lines:

https://www.psychopy.org/builder/blocksCounterbalance.html

You could try and make an outer loop with a condsfile referencing your four excel files. Then your inner loop would be your current ‘trials’, except it will be handed $condsFile (see link above for details).

Like this it will, however, with nRep at 1 in the outer loop, go randomly through all four conditions, repeating your ‘trials’ four times. I would suggest you insert a bit of code to end the outer loop after the inner loop finishes.

https://www.psychopy.org/recipes/builderTerminateLoops.html

Let me know if that helps :slight_smile:

1 Like

Hello! Thanks for your help- you are great! My experiment is almost perfect now for my intentions.

Here is my ‘stop_2’ code:
Outerone.finished=True (in the Begin Routine section)

I have a further question, if you can find the time to answer. If I choose sequential looptype for the outer loop (‘Outerone’), the experiment always picks the same list. If I change it to random, then I will have the risk of ending up with unequal number of participations for four lists. Any suggestions on that?

Thanks in advance :slight_smile:

Hi! Glad to hear it worked out! Honestly, in that case I would probably randomize conditions up front using participant numbers and enter the condition as described in the link to determine which list to select.

Maybe something like this:

I haven’t tried doing that myself yet, but if you get stuck I’ll give it a try when I have some time and we’ll figure it out together. :slight_smile: Good luck!!