Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Recognition (study and test)

37 views
Skip to first unread message

vscript

unread,
Aug 12, 2015, 2:17:21 PM8/12/15
to expyriment-users
I'm new here and having some trouble. Hoping someone can help. The examples are basically all single-phases.

Does anyone have an example of a recognition-memory experiment? I'm trying to pull randomly from a list (e.g., say a list of 100 words) and assign some number (e.g., 50) for a study phase and then all words during the test phase. I need to know which were assigned studied and which were not as well as study order and test order. Obviously there are multiple steps here, but I'm trying to figure out the best approach. A new class? A dictionary? Any examples are helpful. 

Florian Krause

unread,
Aug 13, 2015, 7:01:42 AM8/13/15
to expyrime...@googlegroups.com
Hi vscript,

I guess the easiest way is indeed to use a dictionary which clearly has an ID for each word. You can then get 50 random items from that dict and log their IDs.

Here is some very quick example:


from expyriment import control, design, misc, stimuli


# SETTINGS
ITI  = 1000 # in milliseconds

words = {1: "hello",
         2: "world",
         3: "some",
         4: "more",
         5: "words",
         6: "needed"}


# DESIGN
exp = control.initialize()
exp.add_data_variable_names(["Phase", "WordID", "Studied", "Response", "RT"])

study = design.Block(name="Study phase")
for id in design.randomize.rand_int_sequence(1, len(words.keys()))[:len(words) / 2]:
    t = design.Trial()
    t.set_factor("WordID", id)
    study.add_trial(t)
exp.add_block(study)

test = design.Block(name="Test phase")
for id in design.randomize.rand_int_sequence(1, len(words.keys())):
    t = design.Trial()
    t.set_factor("WordID", id)
    test.add_trial(t)
exp.add_block(test)


# RUN
control.start()

for counter, block in enumerate(exp.blocks):
    stimuli.TextScreen(block.name, "Press [SPACE] to continue").present()
    exp.keyboard.wait(misc.constants.K_SPACE)
    for trial in block.trials:
        word_id = trial.get_factor("WordID")
        stim = stimuli.TextLine(words[word_id])
        exp.clock.wait(ITI - stim.preload())
        stim.present()
        key, rt = exp.keyboard.wait()
        stim.unload()
        exp.data.add([block.id, word_id,
                      word_id in exp.blocks[0].get_trial_factor_values("WordID"),
                      key, rt])

control.end()


I hope this helps.

Best,
Florian



On Wed, Aug 12, 2015 at 8:17 PM, vscript <cook.g...@gmail.com> wrote:
I'm new here and having some trouble. Hoping someone can help. The examples are basically all single-phases.

Does anyone have an example of a recognition-memory experiment? I'm trying to pull randomly from a list (e.g., say a list of 100 words) and assign some number (e.g., 50) for a study phase and then all words during the test phase. I need to know which were assigned studied and which were not as well as study order and test order. Obviously there are multiple steps here, but I'm trying to figure out the best approach. A new class? A dictionary? Any examples are helpful. 

--
You received this message because you are subscribed to the Google Groups "expyriment-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to expyriment-use...@googlegroups.com.
To post to this group, send email to expyrime...@googlegroups.com.
Visit this group at http://groups.google.com/group/expyriment-users.
For more options, visit https://groups.google.com/d/optout.



--
Florian Krause (Developer)
www.expyriment.org

vscript

unread,
Aug 18, 2015, 8:32:59 PM8/18/15
to expyriment-users
Thank you for this. I think this will take me some distance. I wasn't sure if a class was better than a dictionary.
Reply all
Reply to author
Forward
0 new messages