psychopy.org | Reference | Downloads | Github

Randomly choosing words from a list without replacement

If this template helps then use it. If not then just delete and start from scratch.

**Win10
**PsychoPy 33

Hi, I am trying to build an experiment where 5 words are chosen out of 10 in each loop. The problem is, that the words cannot repeat within the experiment. So, the five words chosen in the first loop cannot appear in the second loop. Basically, I need to achieve random selection without replacement.

In the image below I am referring to the routine “trial”. The conditions file, which has 10 rows of words is loaded in the loop “trials_3”

I am super new at this, so I’m sorry if I did not provide enough information. I am assuming I will have to write code to make the experiment do what I want. I was thinking that perhaps I can create an array and load into that array the word that is chosen at each frame and then somehow write code so that the array stops the output of already used words, but I do not know how to code for all of that either.

What is the function of the inner loops trials and trials_2 (perhaps a good illustration of why it is wroth giving things descriptive names)?

i.e. you haven’t really explained the design and procedure. Presumably a new word is selected on each iteration of the outer loop because you said that is the one where the conditions file is attached, but then you talk about words being selected in the first and second inner loop. We can’t really give any useful advice until the procedure is explained fully.

Ok, so I renamed the loops and included a snapshot of my conditions file for a better illustration.

So wordloop is set to itirate 5 times, so that a participant sees 5 words, then they see 1 word (from PMPrompt, the reason I made a loop there is because there are 5 lines and I need it to only show 1 word each time, and it works). Then the experiment loops back around using blockloop, so that the participant sees 5 more words and then 1 more PMPrompt word. Does that clear things up?

image

So, the participants sees only two PMPrompts but 10 wordloop stimuli?

Cheers Jens

Where are your PMprompts in your Excel-sheet?