Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Shuffle datamatrix and update correct response

aswvaswv Posts: 9
edited August 4 in OpenSesame

In my experiment, I have a learning phase as below, where participants are asked to learn the source-target pairing. (i have 6 pairs in original exp)

      var1                            var2
sourceword1             targetword1
sourceword2             targetword2
sourceword3             targetword3

In the testing phase, participants are presented with full factorial pairing and asked to pick the correct combination.

I am using data matrix to read variables from file.

  1. I want to randomize the pairing per participant in the learning phase. For example, for the next participant, I want sourceword1 to be paired with targetword3(randomly). How can I do that in data matrix?
  2. Even if I shuffle the learning phase, how can i update the "correct response" for testing phase ? For example, for the first participant S1 - T1 is the correct pair, but for next participant S1-T3 is the correct pair.
    Now I am reading the full factorial test data also from a file, is it possible to set the correct response inside the code?



  • sebastiaansebastiaan Posts: 2,701


    I don't fully understand what you're trying to do, but here's an idea to get you started: Instead of specifying the words directly, you specify variable names, like so:

    var1                     var2
    [sourceword0]            [targetword0]
    [sourceword1]            [targetword1]
    [sourceword2]            [targetword2]

    And you keep the pairing constant: [sourceword1] is always paired with [targetword1], etc. This makes it easy to determine which pairings are correct during the test phase, right? Because you can just hard-code that.

    Then, to nevertheless randomize which words are paired for each participant, you randomly assign actual words to the sourceword[x] and targetword[x] variables. For example like so:

    import random
    source_words = ['dog', 'cat', 'bunny']
    target_words = ['tree', 'house', 'bottle']
    for i, (source_word, target_word) in enumerate(zip(source_words, target_words)):
        var.set('sourceword%d' % i, source_word)
        var.set('targetword%d' % i, target_word)

    Do you see what I mean? That should make life easier, right? And you don't need to do anything fancy with DataMatrix.


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • aswvaswv Posts: 9

    Dear Sebastiaan,

    In this thread i asked for a solution, which is the reason why I am using data matrix.

    But maybe I can read take the values from the data matrix to a list and manipulate the results as above.

Sign In or Register to comment.