Howdy, Stranger!

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

Supported by

Randomising with constraints - present a certain number of stimuli from each condition

Hello :)

I am using OpenSesame to create an experiment for the first time, and so far all the tutorials and forum discussions have been very helpful. I have found out how to do almost everything I need, but I just do not understand enough about the way that trials within a block are presented, or if I even should try to use blocks at all. Do I need to write a script instead?

In the experiment, participants will be shown a single target word item.

There are 72 words in total, but there are different categories of words. There are 6 categories (at the moment I have thought about them in terms of categories of A, B, C, D, E, F), each containing 12 words. Each word can be displayed in one of 2 forms - either with, or without spaces between the letters (at the moment I have thought about this as a variable called Form with 2 levels, spaced or unspaced).

I would like each participant to see all the words from all categories in a random order, but from each category, 6 words should be shown in the spaced form, and the other 6 words should be shown in the unspaced form. No word should be repeated.

Can anybody help me work out how I can do this?

Thank you!

Comments

  • edited October 2016

    Hi Abby,

    It looks like you're thinking of a Latin-squared design where participants have to be divided into two groups, one where the first six words are shown unspaced and the second six words spaced, and another group where the first six words are shown spaced and the second six words unspaced.

    What I usually do in such situations, is to define stimuli lists at the start of the experiment, based on which group the subject belongs to. You could start an inline_script as follows:

    group = 'A'
    
    if group == 'A':
        stim_list1 = stimuli[0:6]
        stim_list2 = stimuli[6:12]
    elif group == 'B':
        stim_list1 = stimuli[6:12]
        stim_list2 = stimuli[0:6]  
    

    After dividing stimuli into lists, you can randomize the order of appearance of items with the random.shuffle() command. Within each trial, you would retrieve an item from one of the lists with the .pop(0) command. This does require some coding!

    Cheers

    Josh

  • edited October 2016

    Hi Josh,

    Thank you very much for your quick reply. Yes, this sounds like it would work very effectively :)

    Could you please tell me where and how I need to write out each of my stimuli items with their corresponding number to achieve this? I have several lists that need to be halved this way, can I select their item numbers in one line such as [0:6, 12:18, 24:30]?

    Also, this is the first time I have written a script in this language, is there a place where I can learn how to write the .pop(0) command?

    Thank you

    Abby

  • Hello,

    Sorry for the double post. I have been reading about inline scripting all day, and I think this is just too difficult (and very stressful!) for me to understand what to do. I've put a screenshot of my overview so that you can see my experiment in case that helps.

    I can work out which subjects should see which stimuli items in advance, and randomise the presentation order. Is there a way I can write a simple script that says to OS:

    1) Get the subject number for the participant.
    2) If the subject number is 1, show the stimuli in the word_item sketchpad in this order: 1, 2, 3, 4, 5, 6...
    3) If the subject number is 1, show the stimuli in the word_item sketchpad in this order: 6, 5, 4, 3, 2, 1...

    In between each word_item sketchpad, there are other screens that I have set up to appear after a keypress (like the fixation cross).

    I'd be really grateful for any help!

  • Hi,

    1) Get the subject number for the participant.

    This information you can access with var.subject_nr

    2) If the subject number is 1, show the stimuli in the word_item sketchpad in this order: 1, 2, 3, 4, 5, 6...

    That's a little trickier. Most importantly, I don't really understand what you mean with "items in the sketchpad". In general, you could do following:

    orig_list = [1,2,3,4,5,6]
    
    if var.subject_nr%2 == 1: # uneven number, if you have other rules, you can easily change the condition here
        stim_list = orig_list
    elif var.subject_nr%2 == 0: #even subjects
        stim_list = orig_list[-1,-1,-1]
    

    What will happen next with the stim_list, I don't really know (as I didn't understand your experiment entirely), but in any case you have to link the elements in the list to items that you want to draw.

    Hope this helps,

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.